
Osseus Logger
winston based osseus logger module
Install
$ npm install @colucom/osseus-logger
Usage
Configuration
OSSEUS_LOGGER_LOG_LEVEL
- Mandatory. See Winston Logging Levels
- Default log levels:
- DEV environment -
silly
- QA environment -
debug
- PROD envrionment -
info
OSSEUS_LOGGER_NO_CONSOLE_OVERRIDE
- Optional. Set to true if you wish to disable
console override
Note: console override
console.debug ==> logger.debug
console.log ==> logger.debug
console.info ==> no override! can be used to bypass logger functionality
console.warn ==> logger.warn
console.error ==> logger.error
Example
First, create index.js:
const Osseus = require('osseus')
const main = async () => {
try {
const osseus = await Osseus.init()
osseus.logger.debug(`hello logger`)
console.log(`hello logger`)
} catch (err) {
console.error(err)
}
}
main()
Running:
$ node index.js --OSSEUS_LOGGER_LOG_LEVEL 'debug'
Will result in:
2018-06-21T12:38:15.650Z - debug: (Liors-MacBook-Pro.local) (63287) - hello logger
2018-06-21T12:38:15.650Z - debug: (Liors-MacBook-Pro.local) (63287) - hello logger
Contributing
Please see contributing guidelines.
License
Code released under the MIT License.