-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(logging): moved constants to separate file (#12)
- Loading branch information
1 parent
f1786dc
commit f08260e
Showing
2 changed files
with
25 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { LogLevel } from '@nestjs/common'; | ||
|
||
/** | ||
* @see https://github.com/winstonjs/winston?tab=readme-ov-file#logging | ||
*/ | ||
export const NEST_LOG_LEVEL_WINSTON_SEVERITY: Record<LogLevel, number> = { | ||
fatal: 0, | ||
error: 0, | ||
warn: 1, | ||
log: 2, | ||
verbose: 4, | ||
debug: 5 | ||
}; | ||
|
||
export const SEVERITY_TEXT_TO_NEST_LOG_LEVEL: Record<string, LogLevel> = { | ||
FATAL: 'fatal', | ||
ERROR: 'error', | ||
WARN: 'warn', | ||
INFO: 'log', | ||
DEBUG: 'debug', | ||
TRACE: 'verbose', | ||
UNSPECIFIED: 'log' | ||
}; |