aurelia-logging-color
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

aurelia-logging-color

NPM version NPM downloads Build status Coverage Status badge-size-url

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:

image

Note that on windows 8 or below the constructor option is not in effect because there are not many color available.

dependencies

Readme

Keywords

none

Package Sidebar

Install

npm i aurelia-logging-color

Weekly Downloads

8

Version

1.0.5

License

MIT

Unpacked Size

125 kB

Total Files

66

Last publish

Collaborators

  • unional