0.4.3 • Published 7 years ago
osseus-logger v0.4.3
Osseus Logger
winston based osseus logger module
Install
$ npm install osseus-loggerUsage
Configuration
OSSEUS_LOGGER_LOG_LEVELMandatory. See Winston Logging Levels Default log levels: DEV environment -sillyQA environment -debug* PROD envrionment -infoOSSEUS_LOGGER_NO_CONSOLE_OVERRIDE* Optional. Set to true if you wish to disableconsoleoverride
Note: console override
console.debug==>logger.debugconsole.log==>logger.debugconsole.info==> no override! can be used to bypass logger functionalityconsole.warn==>logger.warnconsole.error==>logger.error
Example
First, create index.js:
const Osseus = require('osseus')
const main = async () => {
try {
// init osseus
const osseus = await Osseus.init()
// option #1
osseus.logger.debug(`hello logger`)
// option #2
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 loggerContributing
Please see contributing guidelines.
License
Code released under the MIT License.