-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* scaffold * finally rm pino * consistent target * rm comment
- Loading branch information
Showing
23 changed files
with
512 additions
and
466 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from './toplevel-hack/toplevel-logger'; | ||
export * from './create-pino-http-opts'; | ||
export * from './config'; | ||
export * from './nestjs-logger-fork/structured-logger'; | ||
export * from './logging.module'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { ConfigurableModuleBuilder } from '@nestjs/common'; | ||
import type { LoggerModuleOpts } from './config'; | ||
|
||
export const { | ||
ConfigurableModuleClass, | ||
MODULE_OPTIONS_TOKEN, | ||
OPTIONS_TYPE, | ||
ASYNC_OPTIONS_TYPE, | ||
} = new ConfigurableModuleBuilder<LoggerModuleOpts>() | ||
.setExtras({ isGlobal: true }) | ||
.setClassMethodName('forRoot') | ||
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Global, Module } from '@nestjs/common'; | ||
import { ConfigurableModuleClass } from './logging.module-def'; | ||
import { StructuredLogger } from './nestjs-logger-fork/structured-logger'; | ||
|
||
@Module({ | ||
providers: [StructuredLogger], | ||
exports: [StructuredLogger], | ||
}) | ||
@Global() | ||
export class LoggingModule extends ConfigurableModuleClass {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
type ColorTextFn = (text: string) => string; | ||
|
||
const isColorAllowed = () => process.env.NO_COLOR !== 'true'; | ||
const colorIfAllowed = (colorFn: ColorTextFn) => (text: string) => | ||
isColorAllowed() ? colorFn(text) : text; | ||
|
||
export const clc = { | ||
bold: colorIfAllowed((text: string) => `\x1B[1m${text}\x1B[0m`), | ||
green: colorIfAllowed((text: string) => `\x1B[32m${text}\x1B[39m`), | ||
yellow: colorIfAllowed((text: string) => `\x1B[33m${text}\x1B[39m`), | ||
red: colorIfAllowed((text: string) => `\x1B[31m${text}\x1B[39m`), | ||
magentaBright: colorIfAllowed((text: string) => `\x1B[95m${text}\x1B[39m`), | ||
cyanBright: colorIfAllowed((text: string) => `\x1B[96m${text}\x1B[39m`), | ||
}; | ||
|
||
export const yellow = colorIfAllowed( | ||
(text: string) => `\x1B[38;5;3m${text}\x1B[39m`, | ||
); |
Oops, something went wrong.