UNPKG

629 BJavaScriptView Raw
1"use strict";
2var logger = require('tracer').console({level:'warn'});
3logger.log('hello');
4logger.trace('hello', 'world');
5logger.debug('hello %s', 'world', 123);
6logger.info('hello %s %d', 'world', 123, {foo:'bar'});
7logger.warn('hello %s %d %j', 'world', 123, {foo:'bar'});
8logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object);
9
10//$ node example/level.js
11//2012-03-02T13:41:33.29Z <warn> level.js:6 (Object.<anonymous>) hello world 123 {"foo":"bar"}
12//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] }