Object colors with a plurality of parameters
See original GitHub issueWhen one does
debug({a:1, b:2});
the object properties’ values are printed with colours
but when one does
debug("string", {a:1, b:2});
colours are gone
just FYI
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
WO2001052176A3 - A method of analyzing a plurality of objects ...
These objects may inter alia be represented by colour pixels in an image ... by a plurality of parameters, e.g. the intensities of...
Read more >Method and apparatus for generating a plurality of parameters of an ...
The electrical images from the color camera 12 are processed by the image processor 10 to form a plurality of different representations of...
Read more >OpenAPI Specification - Version 3.0.3 - Swagger
OpenAPI Specification. Version 3.0.3. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", ...
Read more >Assessment of Segmentation Parameters for Object-Based ...
The main objective of this study is to assess OBIA segmentation and classification accuracy depending on shape-color, compactness-smoothness, and band weight ...
Read more >Use parameters to highlight data points in VA reports
Color is a powerful data visualization tool. ... Create parameters and assign to control objects; Create Calculated item flag to represent ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, my guess was that it was this way for historical reasons (
util.format()
has a%O
since v.8.4.0)It’d be more or less easy to have it colored one way or another (debug uses the
...args
rest parameters) and the current code is pretty similar to what you proposed:If it’s not starting with a string, this part could add as many
%O
as there are arguments in one string that is unshifted, but if there’s one it’d need to parse the string, count the already-existing (valid) %* placeholders and add more as needed. (also since Node v10.0 there’sutil.formatWithOptions
which could automatically color everything but that’d break a lot of code that isn’t running on a recent Node?)However, there’s currently https://github.com/visionmedia/debug/issues/582 which aims to give more control over the output format, and ultimately, if possible, to get rid of
DEBUG_COLORS
and the use ofisatty()
, which’d require changes to how the%O
and%o
decide to (/ are made to) color their output… If you have any idea about that, would be great to hear!For now, an already supported way would be to simply override the log method to, for example,
console.log
@Qix- I see the problem and thank you guys for the reply, but how come is the intended behaviour?
Why simply not
Am I missing anything here?