stdout-logger
This is my preferred configuration of Winston Logger module. I think it is nice a simple!
stdout-logger default logging level is debug
and will look for a environment variable DEV_ENV or defaults to "DEV"
. If set to "PROD"
logging level is set to info
and colorized logging is turned off!
Basic look and feel...
How to install?
From command line..
npm install stdout-logger
stdout-logger default config
Default settings of instance Winston Logger.
"colorize": true // set to false to turn colorized messaging off. "json": false // set to true to turn json formated messaging on. "slient": false // set to true to turn off messaging "handleExceptions": true // set to false to turn off handling exceptions "level": "debug" { return ; }
stdout-logger levels
- Level 0 ::
debug
- Level 1 ::
info
- Level 2 ::
silly
- Level 3 ::
warn
- Level 4 ::
error
How to use?
Very easy.. see example below.
// require modulevar Logger = myLogger = Logger; Logger; Logger; // returns "error"console; // Now use logger ;;;;;