npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

strong-logger

1.0.0 • Public • Published

strong-logger

A very simple logger for use with a log aggregating process supervisor like strong-supervisor.

Install

$ npm install --save strong-logger

Usage

var logger = require('strong-logger');
 
logger.debug('ARGV: %j', process.argv);
logger.info('application started');
logger.warn('about to do something horrible!');
logger.error(new Error('Something horrible!'));

Standalone Output

The output is simple and unceromonious, which is exactly what you want in development.

DEBUG ARGV: ["node","/Users/ryan/work/strong-logger/test.js"]
INFO application started
WARN about to do something horrible!
ERROR [Error: Something horrible!]

With strong-supervisor

When it's time to move your app to production, you'll want to use a process supervisor that can decorate these simple logs with additional context details so that you don't have to change your code or toggle any sort of logging behaviour in your app.

2014-06-20T15:26:37.907Z pid:89028 worker:1 DEBUG ARGV: ["/usr/local/bin/node","."]
2014-06-20T15:26:37.908Z pid:89028 worker:1 INFO application started
2014-06-20T15:26:37.908Z pid:89028 worker:1 WARN about to do something horrible!
2014-06-20T15:26:37.908Z pid:89028 worker:1 ERROR [Error: Something horrible!]

Keywords

install

npm i strong-logger

version

1.0.0

license

Artistic-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability