hof-logger

2.0.0 • Public • Published

hof-logger

Common logger pattern

Installation

$ npm install hof-logger --save

Usage

hof-logger exports a function which you can call to access a winston logger instance.

var logger = require('hof-logger')();
 
logger.info('A message');

Options

Options can be passed and take the form of the following example

var createLogger = require('hof-logger');
var logger = createLogger({
  levels: {
    info: 0,
    email: 1,
    warn: 2,
    error: 3
  },
  colours: {
    info: 'green',
    email: 'magenta',
    warn: 'yellow',
    error: 'red'
  },
  transportOptions: {
    json: true,
    timestamp: true,
    colorize: true,
    stringify: JSON.stringify
  }
});

Readme

Keywords

none

Package Sidebar

Install

npm i hof-logger

Weekly Downloads

1

Version

2.0.0

License

ISC

Last publish

Collaborators

  • dk4g
  • jamiecarterho
  • mylrajan
  • william-gu-hof
  • temitopeayoku
  • mdev246
  • vinodha.s
  • chisomoguibe
  • robertmccann
  • rhyad-zergane-ho
  • rhodine
  • mohameduwais
  • lennym
  • easternbloc
  • joefitter
  • coupey
  • sulthan-ahmed
  • andrew.moody.ho
  • aswann
  • robertdeniszczyc2
  • agraham19
  • aaron.robinson
  • sarahjaneluff
  • cmedland
  • hof-bot-user
  • josephchapman