a simple wrapper for winston and winston-daily-rotate-file that i use as a logger for fast prototyping. Ideal for lazy people. This module is just a lazy way to switch from the default console to winston while adding simple daily log files.
If you need a proper module to handle your logging, head over to winston
npm install lazy-logger
The LazyLogger constructor accepts 4 arguments
- The Winston Logging level as indicated by winston check the module's documentation for more.
NOTE
1. can be'silly'
,'debug'
,'verbose'
,'info'
,'warn'
,'error'
- Boolean that dictates the creation of a daily rotating file
- In case
2.
is true a path will be required to store the log files - the date format of the date that will be part of the logfile name
var LazyLogger= new require('lazy-logger');
//initialize a logger object with info level of debug, a path, and a pattern for date
var logger= new LazyLogger('silly',true,'./log-','yyyy-MM-dd');
logger.silly('Silly level');
logger.debug('Debug level');
logger.verbose('Verbose level');
logger.info('Info level');
logger.warn('Warn level');
logger.error('Error level');