I like the effect provided by exception-formatter with option auto, where stack outside of your own code is truncated (automatically).
I can get that effect if I use the formatter directly:
import exceptionFormatter from 'exception-formatter';
const bunyanLogger = bunyan.createLogger({ ... });
bunyanLogger.addSerializers({
// colorize and trim exceptions
err: (e) => exceptionFormatter(e, {
basepath: projectRoot,
colors: true, // highlight our code in stack trace
format: 'ansi', // color
maxLines: 'auto', // auto: truncate code that isn't ours
}),
});

But if I use bunyan-debug-stream with maxExceptionLines: 'auto',
import bunyanDebugStream from 'bunyan-debug-stream';
const bunyanLogger = bunyan.createLogger({ ... });
bunyanLogger.addStream({
stream: bunyanDebugStream({
basepath: projectRoot, // this should be the root folder of your project.
maxExceptionLines: 'auto',
}),
});
it does not truncate (though as shown by the color, it seems exception formatter successfully determines what is my code vs not my code):

See anything I'm missing?
I like the effect provided by
exception-formatterwith optionauto, where stack outside of your own code is truncated (automatically).I can get that effect if I use the formatter directly:
But if I use bunyan-debug-stream with
maxExceptionLines: 'auto',it does not truncate (though as shown by the color, it seems exception formatter successfully determines what is my code vs not my code):
See anything I'm missing?