ZLog is a light-weight logging tool for node.js, which supports logging level, logging color, logging position information, and logging timestamp.
- Just put
zlog.jswhere you need, andrequireit.
- DEBUG 1
- INFO 2
- WARN 3
- ERROR 4
- FATAL 5
There are 5 logging functions in total:
debug, info, warn, error, fatal
Each function takes any number of arguments and print out all of them.
var Z = require('zlog');
Z.log_level = Z.INFO;
var Z = require('zlog');
Z.enable_color = true;
var Z = require('zlog');
Z.enable_color = true; // default is true
Z.log_level = Z.INFO;
Z.info('test info');
Z.warn('test warn, followed by a number', 2);
Z.error('test error, followed by an array', [3, 4]);
Z.fatal('test fatal, followed by an object', {a:1, b:2});
