-
Notifications
You must be signed in to change notification settings - Fork 7.3k
util.inspect() on process.config() and os.networkInterfaces() contains escaped line breaks "\n" #6943
Comments
That's because output in log file is generated using |
Go to your console and do the following: console.log(util.inspect(process.config, {
showHidden: false,
depth: null,
colors: false,
customInspect: false
})); You'll see that the output appears normally. Whereas if you remove So I don't think it's a |
It's because the total output length is over 60 chars, according to: https://github.com/joyent/node/blob/master/lib/util.js#L434 You can recreate this with: util.inspect({
hello: 'world',
foo: 'barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr',
}); Perhaps there should be an option to disable this, for example: thomseddon@0554bfc? |
Sorry here's the diff: https://github.com/thomseddon/node/compare/format-wrap |
@thomseddon Ah, thanks. @tjfontaine what do you think? make that a configurable? |
Just to chime in - the shout for this being configurable would be that if you don't want to output the message in your terminal (such as when logging as in this example) you would disable wrapping. |
I am all for taking anything we have as a predefined constant and moving that into a default for options. And Hopefully once we've moved all of our assumptions into defaults on the options object there will be no more need for us to tweak the interface aside from our own needs. |
Marking this as a feature request as it does not actually appear to be a bug. Rather, the discussion aims towards making the line length configurable somehow. |
reproduced like so:
outputs in log file:
should be:
Logger is a Winston File Logger
while e.g.
util.inspect(process.memoryUsage()));
and others are fine, the output ofutil.inspect(os.networkInterfaces())
andutil.inspect(process.config())
are broken (^)Maybe a Winston problem (Winston uses unix line breaks only) !?
The text was updated successfully, but these errors were encountered: