File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -223,8 +223,26 @@ exports.log = function (options) {
223
223
output += ' ' + options . prettyPrint ( meta ) ;
224
224
} else if ( options . prettyPrint ) {
225
225
output += ' ' + '\n' + util . inspect ( meta , false , options . depth || null , options . colorize ) ;
226
- } else {
226
+ } else if (
227
+ Object . keys ( meta ) . length === 5
228
+ && meta . hasOwnProperty ( 'date' )
229
+ && meta . hasOwnProperty ( 'process' )
230
+ && meta . hasOwnProperty ( 'os' )
231
+ && meta . hasOwnProperty ( 'trace' )
232
+ && meta . hasOwnProperty ( 'stack' ) ) {
233
+
234
+ //
235
+ // If meta carries unhandled exception data serialize the stack nicely
236
+ //
237
+ var stack = meta . stack ;
238
+ delete meta . stack ;
239
+ delete meta . trace ;
227
240
output += ' ' + exports . serialize ( meta ) ;
241
+ output += '\n' + stack . map ( function ( s ) {
242
+ return s + '\n' ;
243
+ } ) ;
244
+ } else {
245
+ output += ' ' + exports . serialize ( meta ) ;
228
246
}
229
247
}
230
248
}
You can’t perform that action at this time.
0 commit comments