@unional/logging
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

@unional/logging

NPM version NPM downloads

Circle CI Travis CI Codecov Coveralls Status

Visual Studio Code Wallaby.js

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:

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() {
  ...
}

/@unional/logging/

    Package Sidebar

    Install

    npm i @unional/logging

    Weekly Downloads

    8

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    116 kB

    Total Files

    68

    Last publish

    Collaborators

    • unional