colorize-log
v0.0.3
Published
Gives Color to your console logs
Downloads
16
Maintainers
Readme
Colorize Log
Installation
--save will save colorize-log to your package dependencies
npm install colorize-log --save
Options
- levels - Array of your custom levels
- colors - Object of your custom levels with their respective colors
- consoleColor - Color of your console
- showLevels - Boolean - Show custom Level before message
- levelsCase - Default is lowercase you can use uppercase and camelcase.
- colorizeLevels - Boolean - if false, level will adopt the consoleCoolor option
Allowed Colors
- Best for "levels colors" - black,red,green,yellow,blue,magenta,cyan,white & gray
- Best for "consoleColor" - reset, bright,dim,underline,blink,reverse & hidden
- Terminal Background colors for "consoleColor" - bgBlack,bgRed,bgGreen,bgYellow,bgBlue,bgMagenta,bgCyan,bgwhite
USAGE
create your own custom console levels and colors
var options = {
levels: ['custom1', 'custom2', 'custom3', 'success'],
colors: {
custom1:'gray',
custom2:'yellow',
custom3:'red',
success:'green'
},
consoleColor: 'cyan', // best to use 'reset'
showLevels:true,
levelsCase:'uppercase', //lowercase,camelcase
colorizeLevels: true
}
var Logger = require('colorize-log')
var Log = new Logger(options)
Log.custom1('Message 1')
Log.custom2('Message 2')
Log.custom3('Message 3')
Log.success('Success Message')