Skip to content

Commit

Permalink
docs(common): add doc strings for common package
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcdo29 committed May 10, 2021
1 parent 0688994 commit 582864a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module.exports = {
'benchmarks',
'cli',
'styler',
'common',
],
],
},
Expand Down
11 changes: 11 additions & 0 deletions packages/common/src/stream.interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
/**
* A simple type to allow for easy use of the `ogma` library on front and backend
* abstracted away from the NodeJS `WritableStream`, though inspiration was drawn from it
*/
export interface OgmaStream {
/**
* The method for actually writing the log. This is made to be as open ended as possible for great extensibility.
*/
write: (message: unknown) => unknown;
/**
* A utility method to determine if color can be used. This should usually return a 1, 4, 8, or 24.
* @see https://nodejs.org/dist/latest-v14.x/docs/api/tty.html#tty_writestream_getcolordepth_env
*/
getColorDepth?: () => number;
}
2 changes: 1 addition & 1 deletion packages/logger/src/logger/ogma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export class Ogma {
public fatal(message: any, meta?: OgmaPrintOptions): void {
this.printMessage(message, {
level: LogLevel.FATAL,
formattedLevel: style.redBg.white.underline.apply(
formattedLevel: this.style.redBg.white.underline.apply(
this.wrapInBrackets(LogLevel[LogLevel.FATAL]),
),
...meta,
Expand Down

0 comments on commit 582864a

Please sign in to comment.