File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " git-json-resolver " : patch
3
+ ---
4
+
5
+ Timestampt log files
Original file line number Diff line number Diff line change @@ -67,7 +67,12 @@ export const createLogger = (config: LoggerConfig = {}) => {
67
67
const flush = ( ) => {
68
68
if ( mode === "memory" ) {
69
69
for ( const [ fileId , entries ] of buffers . entries ( ) ) {
70
- const filePath = path . join ( logDir , singleFile ? "combined.log" : `${ fileId } .log` ) ;
70
+ const filePath = path . join (
71
+ logDir ,
72
+ singleFile
73
+ ? `combined-${ new Date ( ) . toISOString ( ) } .log`
74
+ : `${ fileId } -${ new Date ( ) . toISOString ( ) } .log` ,
75
+ ) ;
71
76
const lines = entries . map ( e => `[${ e . timestamp } ] [${ e . level . toUpperCase ( ) } ] ${ e . message } ` ) ;
72
77
fs . writeFileSync ( filePath , lines . join ( "\n" ) + "\n" , { flag : "a" } ) ;
73
78
}
You can’t perform that action at this time.
0 commit comments