Winston Logger Impl
Simple winston logger implementation to allow override of console.log. Also provide customization of Machine Id and Source file line number.
Installing
Simply install through npm for winston-logger-impl
npm --save install winston-logger-impl
Usuage
By default the logger will initialize with the following based on process.env, but you can always override it.
var isProduction = processenvNODE_ENV && processenvNODE_ENV === 'prod' || 'AWS_EXECUTION_ENV' in processenv; if !optionslevel && isProduction optionslevel = 'warn'; if !optionsformat && isProduction optionsformat = 'json';
Simple
const loggerImpl = ;// global initializeloggerImpl;console;console;console;console;
Customizable Options
// globalloggerImpl console;console;console;console;
getLogger
The getLogger method will return a winston logger with the transport of Console. Only 'format' and 'level' is supported.
const logger = loggerImpl;logger;logger;logger;
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Authors
- Sheng Huang
License
This project is licensed under the MIT License