log-facade
Structured log facade for NodeJs to abstract away the choice of a particular logger.
Installation
$ npm install log-facade
Usage
var logger = ;logger;logger;logger;logger;
Configuration
var logFacade = ;logFacade;
To create a target, implement all the level functions. For a simple console logger:
{ return { consolefunlvl + ' - ' + src + ' - ' + datamsg; };} var impl = 'trace': 'debug': 'verbose': 'info': 'warn': 'error': 'fatal': ;
Or, to add some metadata and send straight json to Winston:
var winston = ; var winstonLogger = new winstonLogger transports: new winstontransportsFile filename: 'test.log' json: false { return JSON; } ; { return { datatimestamp = ; datasource = src; datalevel = lvl; winstonLoggerfundata; };} var impl = 'trace': 'debug': 'verbose': 'info': 'warn': 'error': 'fatal': ;