0.5.3 • Published 5 years ago
@colucom/osseus-logger v0.5.3
Osseus Logger
winston based osseus logger module
Install
$ npm install @colucom/osseus-loggerUsage
Configuration
- OSSEUS_LOGGER_LOG_LEVELMandatory. See Winston Logging Levels Default log levels: DEV environment -- sillyQA environment -- debug* PROD envrionment -- info
- OSSEUS_LOGGER_NO_CONSOLE_OVERRIDE* Optional. Set to true if you wish to disable- consoleoverride
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 {
		// 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.