infolis-logging
@infolis' best practices for logging with winston
Usage
Without configuration:
var log = module; log;
This will log to
- STDOUT with color highlighting the log level and dumping any additional arguments using
util.dump
after breaking up circular references. - a file
logs/#{__filename of the js module}.log
file
With configuration:
Create a module log.js
(just a convention, can be anything):
var InfolisLogging = ;module { return ;});
Then reference that module in your code instead of infolis-logging
var log = modulelog;
API
Since it's just a thin layer atop Winston, the winston API can be used.
In addition, timers can be set up with logstart
and logstop
to profile things.