Simple logger

npm install pragma-logger
2 downloads in the last week
4 downloads in the last month

Pragma Logger NPM version

This is a simple logger with filename formatting and different levels of logging.


To install just use NPM

npm install pragma-logger

var PragmaLogger = require('../PragmaLogger'),
  logger = new PragmaLogger({
    logger: {
      charset: 'utf8',
      levels: {
        debug: './logs/%pid_debug_%y-%m-%d.log',
        error: './logs/%pid_error_%y-%m-%d.log',
        warn: './logs/%pid_warn_%y-%m-%d.log',
        trace: './logs/%pid_trace_%y-%m-%d.log',
        info: './logs/%pid_info_%y-%m-%d.log'
      messageFormat: '%t \t| %name :: %lvl \t| PID: %pid - %msg'
  }, 'my awesome logger');

logger.debug('Here is debug message');
logger.error(new Error('Here is error message'));
logger.warn('Here is warn message');
logger.trace('Here is trace message');'Here is info message');

Pragma Dudes wish you live long and prosper.

npm loves you