1 | ;
|
2 | var logger = require('tracer').colorConsole();
|
3 | logger.log('hello');
|
4 | logger.trace('hello', 'world');
|
5 | logger.debug('hello %s', 'world', 123);
|
6 | logger.info('hello %s %d', 'world', 123, {foo:'bar'});
|
7 | logger.warn('hello %s %d %j', 'world', 123, {foo:'bar'});
|
8 | logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object);
|
9 | logger.fatal('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object);
|
10 |
|
11 | //$ node example/colorConsole.js
|
12 | //2012-03-02T13:43:09.27Z <log> colorConsole.js:3 (Object.<anonymous>) hello
|
13 | //2012-03-02T13:43:09.29Z <trace> colorConsole.js:4 (Object.<anonymous>) hello world
|
14 | //2012-03-02T13:43:09.29Z <debug> colorConsole.js:5 (Object.<anonymous>) hello world 123
|
15 | //2012-03-02T13:43:09.29Z <info> colorConsole.js:6 (Object.<anonymous>) hello world 123 { foo: 'bar' }
|
16 | //2012-03-02T13:43:09.29Z <warn> colorConsole.js:7 (Object.<anonymous>) hello world 123 {"foo":"bar"}
|
17 | //2012-03-02T13:43:09.29Z <error> colorConsole.js:8 (Object.<anonymous>) hello world 123 {"foo":"bar"} [ 1, 2, 3, 4 ] function Object() { [native code] }
|
18 | //2012-03-02T13:43:09.29Z <fatal> colorConsole.js:8 (Object.<anonymous>) hello world 123 {"foo":"bar"} [ 1, 2, 3, 4 ] function Object() { [native code] }
|