mirror of
https://github.com/debug-js/debug.git
synced 2026-01-25 16:42:28 +00:00
Updated example/stdout.js to match debug current behaviour
This commit is contained in:
parent
05d9fa7f8c
commit
9e61ecb64b
@ -1,17 +1,17 @@
|
||||
var debug = require('../');
|
||||
var log = debug('app:log');
|
||||
|
||||
// by default console.log is used
|
||||
log('goes to stdout!');
|
||||
|
||||
var error = debug('app:error');
|
||||
// set this namespace to log via console.error
|
||||
error.log = console.error.bind(console); // don't forget to bind to console!
|
||||
error('goes to stderr');
|
||||
log('still goes to stdout!');
|
||||
|
||||
// set all output to go via console.warn
|
||||
// by default stderr is used
|
||||
error('goes to stderr!');
|
||||
|
||||
var log = debug('app:log');
|
||||
// set this namespace to log via console.log
|
||||
log.log = console.log.bind(console); // don't forget to bind to console!
|
||||
log('goes to stdout');
|
||||
error('still goes to stderr!');
|
||||
|
||||
// set all output to go via console.info
|
||||
// overrides all per-namespace log settings
|
||||
debug.log = console.warn.bind(console);
|
||||
log('now goes to stderr via console.warn');
|
||||
error('still goes to stderr, but via console.warn now');
|
||||
debug.log = console.info.bind(console);
|
||||
error('now goes to stdout via console.info');
|
||||
log('still goes to stdout, but via console.info now');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user