File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export interface LogMessageOptions {
3737 indent ?: number ;
3838 format ?: ( line : string ) => string ;
3939 colorize ?: boolean ;
40+ stripAnsiCode ?: boolean ;
4041}
4142
4243// deno-lint-ignore no-explicit-any
@@ -229,6 +230,7 @@ export class LogFileHandler extends FileHandler {
229230 ...logRecord . args [ 0 ] as LogMessageOptions ,
230231 bold : false ,
231232 dim : false ,
233+ stripAnsiCode : true ,
232234 format : undefined ,
233235 } ;
234236 let msg = applyMsgOptions ( logRecord . msg , options ) ;
@@ -417,7 +419,9 @@ function applyMsgOptions(msg: string, options: LogMessageOptions) {
417419 if ( options . format ) {
418420 msg = options . format ( msg ) ;
419421 }
420-
422+ if ( options . stripAnsiCode ) {
423+ msg = colors . stripAnsiCode ( msg ) ;
424+ }
421425 return msg ;
422426}
423427
You can’t perform that action at this time.
0 commit comments