diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-03-15 14:10:43 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-04-12 23:23:57 +0200 |
commit | 565fd50b4ac81c8c3fca6a08ffcbc59a4b7b2504 (patch) | |
tree | db8b2acdc3ab3ac7c7b9a67f563dff30022f6ff2 /test/pseudo-tty/console_colors.js | |
parent | 57e8793c4393aa3fafd87f289b19078b1918c166 (diff) | |
download | android-node-v8-565fd50b4ac81c8c3fca6a08ffcbc59a4b7b2504.tar.gz android-node-v8-565fd50b4ac81c8c3fca6a08ffcbc59a4b7b2504.tar.bz2 android-node-v8-565fd50b4ac81c8c3fca6a08ffcbc59a4b7b2504.zip |
console: auto-detect color support by default
This makes Node pretty-print objects with color by default
when `console.log()`-ing them.
PR-URL: https://github.com/nodejs/node/pull/19372
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/pseudo-tty/console_colors.js')
-rw-r--r-- | test/pseudo-tty/console_colors.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/pseudo-tty/console_colors.js b/test/pseudo-tty/console_colors.js new file mode 100644 index 0000000000..dd16a0c028 --- /dev/null +++ b/test/pseudo-tty/console_colors.js @@ -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' }); |