File tree 1 file changed +4
-8
lines changed
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -140,23 +140,19 @@ export class MidwayBaseLogger extends WinstonLogger implements IMidwayLogger {
140
140
141
141
protected log ( level , ...args ) {
142
142
const originArgs = [ ...args ] ;
143
- let meta , msg ;
143
+ let meta ;
144
144
if ( args . length > 1 && isPlainObject ( args [ args . length - 1 ] ) ) {
145
145
meta = args . pop ( ) ;
146
146
} else {
147
147
meta = { } ;
148
148
}
149
149
150
- const last = args . pop ( ) ;
151
- if ( last instanceof Error ) {
152
- msg = util . format ( ...args , last ) ;
153
- meta [ ORIGIN_ERROR ] = last ;
154
- } else {
155
- msg = util . format ( ...args , last ) ;
150
+ if ( args . length > 0 && args [ args . length - 1 ] instanceof Error ) {
151
+ meta [ ORIGIN_ERROR ] = args . pop ( ) ;
156
152
}
157
153
158
154
meta [ ORIGIN_ARGS ] = originArgs ;
159
- return super . log ( level , msg , meta ) ;
155
+ return super . log ( level , ... args , meta ) ;
160
156
}
161
157
162
158
disableConsole ( ) : void {
You can’t perform that action at this time.
0 commit comments