electron-log icon indicating copy to clipboard operation
electron-log copied to clipboard

Passing console logs depth

Open rasgo-cc opened this issue 3 years ago • 1 comments

Currently the console logs have a depth of 2 or 3 I believe. I mean, when printing nested objects, from that depth level they start being printed as [object Object]

Any way to pass the depth?

Related: https://nodejs.org/api/util.html#util_util_inspect_object_options

rasgo-cc avatar Nov 19 '20 16:11 rasgo-cc

Currently, util.formatWithOptions used only for file transport, for console direct calling of console.log is used. Currently, I have no plans to change it, but will think about it in the future.

megahertz avatar Nov 19 '20 17:11 megahertz

In v5 it's possible to write a custom function for writing to console, eg

log.transports.console.writeFn = ({ message }) => console.log(util.inspect(message.data));
``

megahertz avatar Nov 24 '22 12:11 megahertz