aurelia-logging-color
v1.0.5
Published
ColorAppender for `aurelia-logging`
Downloads
1,472
Readme
aurelia-logging-color
ColorAppender
for aurelia-logging
and @unional/logging
.
Why color
Logging is a great tool. But it is also heavily underutilized. One major reason is that when we log a lot of stuff, we can quickly get overwhelmed by all those information.
aurelia-logging
allows you to create different loggers for different part of your application, as fine grain as you wanted.
However, it still does not solve the issue above.
Coloring the log message helps you to pick the relevant information much easier.
Usage
import { addAppender, setLevel, getLogger, logLevel } from 'aurelia-logging' // or '@unional/logging'
import { ColorAppender } from 'aurelia-logging-color'
addAppender(new ColorAppender())
// turn on logging (this example do it globally)
setLevel(logLevel.info)
const loggerA = getLogger('Logger A')
loggerA.warn('Pretty Color')
const loggerB = getLogger('Logger B')
loggerB.info('Nother pretty color!')
Gives you:
Note that on windows 8 or below the constructor option is not in effect because there are not many color available.