forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
console: auto-detect color support by default
This makes Node pretty-print objects with color by default when `console.log()`-ing them. PR-URL: nodejs#19372 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Loading branch information
Showing
4 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
require('../common'); | ||
// Make this test OS-independent by overriding stdio getColorDepth(). | ||
process.stdout.getColorDepth = () => 8; | ||
process.stderr.getColorDepth = () => 8; | ||
|
||
console.log({ foo: 'bar' }); | ||
console.log('%s q', 'string'); | ||
console.log('%o with object format param', { foo: 'bar' }); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ foo: *[32m'bar'*[39m } | ||
string q | ||
{ foo: *[32m'bar'*[39m } with object format param |