@brickyard/logger

a logger for brickyard with time format

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@brickyard/logger
Minified + gzip package size for @brickyard/logger in KB

Readme

brickyard logger

Install

npm i @brickyard/logger

Usage

const logger = require('@brickyard/logger')
// logger.Level: TRACE, DEBUG, INFO, WARN, ERROR
logger.setLevel(logger.Level.TRACE)
const console = logger.console
console.trace('this is trace level log')
console.debug('this is debug level log')
console.log('this is log level log')
console.info('this is info level log')
console.warn('this is warn level log')
console.error('this is error level log')

or

const logger = require('@brickyard/logger')
// logger.Level: TRACE, DEBUG, INFO, WARN, ERROR
logger.setLevel(logger.Level.TRACE)
// pass param true to hack, false to restore, default true
logger.hackConsole()
console.trace('this is trace level log')
console.debug('this is debug level log')
console.log('this is log level log')
console.info('this is info level log')
console.warn('this is warn level log')
console.error('this is error level log')

output

[T 180314 09:41:39.600 +0800] this is trace level log
[D 180314 09:41:39.654 +0800] this is debug level log
[I 180314 09:41:39.697 +0800] this is log level log
[I 180314 09:41:39.708 +0800] this is info level log
[W 180314 09:41:39.717 +0800] this is warn level log
[E 180314 09:41:40.527 +0800] this is error level log

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.