mirror of
https://github.com/zhigang1992/now-deployment.git
synced 2026-04-01 22:40:47 +08:00
13 lines
629 B
JavaScript
13 lines
629 B
JavaScript
"use strict";
|
|
var logger = require('tracer').console({level:'warn'});
|
|
logger.log('hello');
|
|
logger.trace('hello', 'world');
|
|
logger.debug('hello %s', 'world', 123);
|
|
logger.info('hello %s %d', 'world', 123, {foo:'bar'});
|
|
logger.warn('hello %s %d %j', 'world', 123, {foo:'bar'});
|
|
logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object);
|
|
|
|
//$ node example/level.js
|
|
//2012-03-02T13:41:33.29Z <warn> level.js:6 (Object.<anonymous>) hello world 123 {"foo":"bar"}
|
|
//2012-03-02T13:41:33.30Z <error> level.js:7 (Object.<anonymous>) hello world 123 {"foo":"bar"} [ 1, 2, 3, 4 ] function Object() { [native code] }
|