stream-log-level
Simple and lightweight logger that writes to a stream.
This module is likeconsole-log-level
but instead of
using the console
object it uses a given stream.
Log levels supported: trace, debug, info, warn, error and fatal.
Install
npm install --save stream-log-level
Usage
var logger = ; var log = ; log; // => does nothinglog; // => does nothinglog; // => writes 'c\n' to STDOUTlog; // => writes 'd\n' to STDOUTlog; // => writes 'e\n' to STDOUTlog; // => writes 'f\n' to STDOUT
Options
The logger can be configured by passing in an options object:
var logger = ; var log = ;
Supported options:
Name | Description | Type | Default value |
---|---|---|---|
level | Specify the log level | String |
info |
prefix | Set a prefix for all log messages | String or Function |
undefined |
stream | The stream to write to | Stream |
process.stdout |