-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
console: add color support #19372
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
Closed
Closed
console: add color support #19372
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
75cc568
util: introduce `formatWithOptions()`
addaleax 565d8c3
doc: document `Console(…, ignoreErrors)` option
addaleax ec7741f
console: allow `options` object as constructor arg
addaleax 313f29c
console: add color support
addaleax 0e52d4b
console: auto-detect color support by default
addaleax File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
console: allow
options object as constructor arg
- Loading branch information
commit ec7741fa20d62907a8c617b974f9238610fa7493
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vsemozhetbyt The doctool doesn’t seem to be able to handle this anymore, since 9a6dd07?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean two consecutive headings? I cannot say why it should not. We have many of them in the
bufer.mdand they seem to be handled properly. Do you encounter issues with tests or doc building?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, now I've tested this. It seems the consecutive headings we already have contain similar parameters and they do not differ from the list parameters below. Before 9a6dd07, these differences were checked, but they did not throw, just reported to stderr. It seems we should either split the section or change the parser strictness, which may not be good for detecting differences between signatures and parameter lists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, consecutive headings are parsed (and were parsed) as clones: the section bodies are copied and checked identically: see here and here. This is not changed in 9a6dd07, I've just make the differences throw.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compare How we usually split sections with different signatures:
https://nodejs.org/api/assert.html#assert_assert_fail_message
https://nodejs.org/api/assert.html#assert_assert_fail_actual_expected_message_operator_stackstartfunction
https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_array
https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length
https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback
https://nodejs.org/api/fs.html#fs_fs_write_fd_string_position_encoding_callback
But with similar signatures:
https://nodejs.org/api/buffer.html#buffer_buf_readdoublebe_offset_noassert
https://nodejs.org/api/buffer.html#buffer_buf_readdoublele_offset_noassert
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So two headings with a similar name but different signatures do not confuse the JSON parser as far as the second signature is in sync with the parameter list below. However, it seems this is still the only case in our docs for now. And it can be a bit confusing: the first signature parameters are not openly listed (they are similar to object properties/options fields, but this is a bit non-formal way). Maybe we can split them, add an own minimal parameter list to the first signature and a link to the common description in the second section? It is a vague thing for me and it is not a strong opinion, so feel free to ignore) We still have a valid JSON (just a bit overflooded with parameter list clones) and the doc is still pretty readable in this way.