Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Simple logger for node.js projects.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
example
.gitignore
.jscs.json
.jshintrc
.npmignore
LICENCE
PragmaLogger.js
README.md
package.json

README.md

Pragma Logger NPM version

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

Usage

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');
logger.info('Here is info message');

Pragma Dudes wish you live long and prosper.

info@pragma-dudes.org

Something went wrong with that request. Please try again.