Skip to content

a simple wrapper for winston and winston-daily-rotate-file that i use as a logger for fast prototyping. Ideal for lazy people.

License

Notifications You must be signed in to change notification settings

slysterous/lazy-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lazy-logger

Version npmnpm DownloadsBuild StatusDependencies Known Vulnerabilities NPM

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

Installation

npm install lazy-logger

Usage

The LazyLogger constructor accepts 4 arguments

  1. 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'
  2. Boolean that dictates the creation of a daily rotating file
  3. In case 2. is true a path will be required to store the log files
  4. 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');

About

a simple wrapper for winston and winston-daily-rotate-file that i use as a logger for fast prototyping. Ideal for lazy people.

Resources

License

Stars

Watchers

Forks

Packages

No packages published