-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node: %O
(big O) pretty-prints the object
#322
Conversation
How can I print objects with many layers on one line? |
Using lower-case |
@TooTallNate it doesn't do the job though, it prints |
Yes I see. We need a way to configure the |
^ That should probably be a separate PR though. |
@TooTallNate thinking minor semver for this? |
Well considering |
@TooTallNate kinda thinking we should expand the API for depth with this release. Set a default value and make the api option for changing depth non-breaking. Thoughts? |
%O
(big O) pretty-prints the object%O
(big O) pretty-prints the object
@TooTallNate can you update the docs |
Also @TooTallNate can you add docs for this in the PR as well? |
@TooTallNate any update on docs man? Also, we need to resolve conflicts on this. I'd like to release 2.4 this week |
For example: ```js var debug = require('./')('foo') var o = { foo: 'bar', b: new Buffer(10), c: Math.PI } debug('%O', o) ``` Previously: ``` foo { foo: 'bar', b: <Buffer 01 00 00 00 01 00 00 00 c0 82>, c: 3.141592653589793 } +0ms ``` Now: ``` foo { foo: 'bar', foo b: <Buffer 01 00 00 00 01 00 00 00 c0 82>, foo c: 3.141592653589793 } +0ms ``` This is a breaking change for anybody relying on the old `%O` behavior. Though I don't think `%O` was working previously because the formatters regexp wasn't checking for uppercase formatters (now fixed in this patch).
c0a83f8
to
253f9dd
Compare
@z-vr you may try this, it fully prints the object, but you lose colours
|
For example:
Previously:
Now:
This is a breaking change for anybody relying on the old
%O
behavior.Though I don't think
%O
was working previously because the formattersregexp wasn't checking for uppercase formatters (now fixed in this patch).