main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
373 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | module.exports = inspectorLog;
|
---|
| 2 |
|
---|
| 3 | // black hole
|
---|
| 4 | const nullStream = new (require('stream').Writable)();
|
---|
| 5 | nullStream._write = () => {};
|
---|
| 6 |
|
---|
| 7 | /**
|
---|
| 8 | * Outputs a `console.log()` to the Node.js Inspector console *only*.
|
---|
| 9 | */
|
---|
| 10 | function inspectorLog() {
|
---|
| 11 | const stdout = console._stdout;
|
---|
| 12 | console._stdout = nullStream;
|
---|
| 13 | console.log.apply(console, arguments);
|
---|
| 14 | console._stdout = stdout;
|
---|
| 15 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.