File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,22 @@ export type ILogger = winston.Logger;
88const logLevel = process . env . LOG_LEVEL ?? 'info' ;
99const silent = process . env . LOG_SILENT === 'true' ;
1010
11- // Add colors for custom levels (fatal, warn, trace) that aren't in default color schemes
11+ const customLevels = {
12+ fatal : 0 ,
13+ warn : 4 ,
14+ trace : 7 ,
15+ } ;
16+
17+ // naming all darn levels to make sure we never get any errors with the logger
1218winston . addColors ( {
19+ emerg : 'red' ,
20+ alert : 'red' ,
21+ crit : 'red' ,
22+ error : 'red' ,
23+ warning : 'yellow' ,
24+ notice : 'cyan' ,
25+ info : 'green' ,
26+ debug : 'blue' ,
1327 fatal : 'red' ,
1428 warn : 'yellow' ,
1529 trace : 'gray' ,
@@ -112,11 +126,7 @@ export function createLogger({ name }: { name: string }): ILogger {
112126 format,
113127 transports,
114128 silent,
115- // Add ISO levels of logging from PINO
116- levels : Object . assign (
117- { fatal : 0 , warn : 4 , trace : 7 } ,
118- winston . config . syslog . levels ,
119- ) ,
129+ levels : Object . assign ( { } , customLevels , winston . config . syslog . levels ) ,
120130 } ) ;
121131
122132 return logger ;
You can’t perform that action at this time.
0 commit comments