@unional/logging
v1.0.5
Published
A logging library that doesn't suck
Downloads
1,439
Readme
@unional/logging
A logging library that doesn't suck.
This library was based on aurelia-logging
.
In 1.0, the coupling is mostly eliminated and the only thing shared is the logLevel
and the general design.
You can use any of the following appender with this library:
- `aurelia-logging-simple-console (this is the default appender)
aurelia-logging-color
aurelia-logging-memory
aurelia-logging-console
(pending on this PR)
Usage
import { getLogger } from '@unional/logging'
const log = getLogger('mylogger')
log.error(...)
log.warn(...)
log.info(...)
log.debug(...)
log.onError(log => log(getLogMessageThatIsTimeConsumingToCreate()))
log.onWarn(...)
log.onInfo(...)
log.onDebug(...)
// or
log.onError(() => getLogMessageThatIsTimeConsumingToCreate())
function getLogMessageThatIsTimeConsumingToCreate() {
...
}