@@ -66,14 +66,15 @@ export default class Logger {
6666 format : winston . format . combine (
6767 winston . format . timestamp ( { format : 'YYYY-MM-DD HH:mm:ss' } ) ,
6868 winston . format . printf ( ( info ) => {
69+ const redactedInfo = this . redact ( info ) ; // Apply redaction here
6970 const colorizer = winston . format . colorize ( ) ;
7071
7172 // Handle success type specifically
72- const levelToColorize = info . level ;
73+ const levelToColorize = redactedInfo . level ;
7374 const levelText = levelToColorize . toUpperCase ( ) ;
7475
75- const timestamp = info . timestamp ;
76- const message = info . message ;
76+ const timestamp = redactedInfo . timestamp ;
77+ const message = redactedInfo . message ;
7778
7879 let fullLine = `[${ timestamp } ] ${ levelText } : ${ message } ` ;
7980 return colorizer . colorize ( levelToColorize , fullLine ) ;
@@ -111,10 +112,6 @@ export default class Logger {
111112 }
112113 }
113114
114- private isLogEntry ( obj : any ) : obj is LogEntry {
115- return typeof obj === 'object' && 'level' in obj && 'message' in obj ;
116- }
117-
118115 private shouldLog ( level : LogType , target : 'console' | 'file' ) : boolean {
119116 const configLevel = target === 'console' ? this . config . consoleLogLevel : this . config . logLevel ;
120117 const minLevel = configLevel ? logLevels [ configLevel ] : 2 ; // default: info
0 commit comments