similar to colors.js
colors and styles are same as colors.js except extras
npm install @wangxingxin/console
const logger = require('@wangxingxin/console')
logger.log('log.name', 'log.message') // log.name:log.message
logger.warn('FBI WARNING!') // FBI WARNING!
logger.error('error.name', {a: 'something wrong'})
// error.name:{"a":"something wrong"}
logger.define({
key: 'custom1',
nameStyle: ['bold', 'underline', 'brightRed'],
msgStyle: ['brightWhite'],
split: ':'
})
logger.define({
key: 'custom2',
nameStyle: ['white', 'italic'],
msgStyle: ['green'],
split: '----'
})
And then you can use logger.custom1(name, message)
or logger.custom2(name, message)
you can also use one param logger.custom1(message)
copy from colors.js
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- gray
- grey
- brightRed
- brightGreen
- brightYellow
- brightBlue
- brightMagenta
- brightCyan
- brightWhite
- bgBlack
- bgRed
- bgGreen
- bgYellow
- bgBlue
- bgMagenta
- bgCyan
- bgWhite
- bgGray
- bgGrey
- bgBrightRed
- bgBrightGreen
- bgBrightYellow
- bgBrightBlue
- bgBrightMagenta
- bgBrightCyan
- bgBrightWhite
- reset
- bold
- dim
- italic
- underline
- inverse
- hidden
- strikethrough