Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

nodeswork-logger

0.0.2 • Public • Published

nodeswork-logger

Wrapper of winston logger, shared between nodeswork repos.

Installation

$ npm i -S nodeswork-logger

How to use

Nodeswork Logger uses object's properties to create new winston instances each time when the logger reference being called. This is because we set label to the actual file path of the caller. So for performance consideration, reference the logger object at the top of the file where it is used.

Default Logger

{logger} = require('nodeswork-logger');
 
logger.info("This is a test log.");
logger.error("Want to see an error log.");

Create new logger using customized transports

winston  = require 'winston'
nwLogger = require 'nodeswork-logger'
 
nwLogger.addLogger 'requestLog'transports: [
  nwLogger.transport winston.transports.Console{
    colorize: true
  }
]
 
{requestLog} = require 'nodeswork-logger'
 
requestLog.info "Another one without timestamp."

install

npm i nodeswork-logger

Downloadsweekly downloads

1

version

0.0.2

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability