File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ planned for 2026-01-01
2929### Updated
3030
3131- [ core] Update dependencies (#3909 , #3916 , #3921 , #3925 )
32- - [ logger] Add prefixes to most Log messages (#3923 )
32+ - [ logger] Add prefixes to most Log messages (#3923 , # 3926 )
3333
3434## [ 2.33.0] - 2025-10-01
3535
Original file line number Diff line number Diff line change 66
77 // add timestamps in front of log messages
88 require ( "console-stamp" ) ( console , {
9- format : ":date(yyyy-mm-dd HH:MM:ss.l) :label(7) :msg" ,
9+ format : ":date(yyyy-mm-dd HH:MM:ss.l) :label(7) :pre() : msg" ,
1010 tokens : {
11+ pre : ( ) => {
12+ const err = new Error ( ) ;
13+ Error . prepareStackTrace = ( _ , stack ) => stack ;
14+ const stack = err . stack ;
15+ Error . prepareStackTrace = undefined ;
16+ try {
17+ for ( const line of stack ) {
18+ const file = line . getFileName ( ) ;
19+ if ( file && ! file . includes ( "node:" ) && ! file . includes ( "js/logger.js" ) && ! file . includes ( "node_modules" ) ) {
20+ const filename = file . replace ( / .* \/ ( .* ) .j s / , "$1" ) ;
21+ return styleText ( "grey" , `[${ filename } ]` ) ;
22+ }
23+ }
24+ } catch ( err ) {
25+ return styleText ( "grey" , "[unknown]" ) ;
26+ }
27+ } ,
1128 label : ( arg ) => {
1229 const { method, defaultTokens } = arg ;
1330 let label = defaultTokens . label ( arg ) ;
You can’t perform that action at this time.
0 commit comments