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



Wrapper of winston logger, shared between nodeswork repos.


$ 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');"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' "Another one without timestamp."