fm-log
What?
Straight-forward logging module.
- lines up everything in nice columns
- uses colors
- sends everything straight to
process.stderr
(no events, nonextTick()
) if desired - condenses repeated messages
- displays stack traces for logged Error instances and other multi-line content nicely
- optionally displays the source of the logging call
- supports wrapping of morgan in your express app
- can replace the debug module, using hartwig-at/debug
Example
var log = ; log;log;log; log;log;log; log = ;log; log = ;log; log = ;log; log = ;log;
// Wrap morganapp;
How?
Install
npm install fm-log
Put this in every file where you want to log:
var log = ;
Then just use log.info
or one of the other logging levels shown above.
For loggers without a specific prefix, just require()
the module and use it directly:
var generic = ;generic;
To log to a different stream (process.stdout
is the default), use .to()
:
var logger = ;
To send data straight to the output stream (without nextTick()
), use .sync()
:
var logger = ;