1.0.3 • Published 6 years ago

@greenrenge/logger v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

Greenrenge Logger

Example

const logger = require(@greenrenge/logger)('test:example')
logger.info('this is an info')
logger.error('this is an error)
logger.log('debug','this is an debug)

In case of winston injection setting

var logger = new winston.Logger({
  transports: [
    new winston.transports.Console({
      name: 'console.info',
      level: 'info',
      timestamp: true,
      colorize: true
    })
  ]
})
const logger = require(@greenrenge/logger).getLog(logger)('this_is_my_winston_transport')

Log under the hood depends on which NODE_ENV currently run on.

  • production --> sent all to winston
  • others --> debug

Important note

  • debug level is always on concepts of 'debug' module, use DEBUG=*,-*agenda*for example, see debug documents
  • other levels on winston will be always logged out while on debug will depend on 'debug' module concepts
1.0.3

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago