@invisible/logger
TypeScript icon, indicating that this package has built-in type declarations

4.0.7 • Public • Published

logger

CircleCI

Invisible Logging Wrapper.

Install

yarn add @invisible/logger

Usage

const logger = require('@invisible/logger')

logger.debug('This is a debug message', { meta: true })

Make sure to set LOGGER_LEVEL = silly on your development environment.

Default Transports

Console

Will only be colorized in development. The default logging level is info, but you can use the LOGGER_LEVEL environment variable to adjust the logging level.

Disabled by default in test env, but can be overriden if LOGGER_ENABLED_IN_TEST is true.

Timber

To use Timber, you'll need to define LOGGER_TIMBER as true in your environment variable and redirect the drain of your Heroku app to the drain address in Timber. You can also use the TIMBER_LEVEL environment variable to set the logging level. Setting up Timber deactivates the default Console transport.

Additional Transports

You can add an additional transport with

const logger = require('@invisible/logger')

logger.add(winston.transports.File, { filename: 'somefile.log' })

/@invisible/logger/

    Package Sidebar

    Install

    npm i @invisible/logger

    Weekly Downloads

    7

    Version

    4.0.7

    License

    MIT

    Unpacked Size

    14.4 kB

    Total Files

    9

    Last publish

    Collaborators

    • brittonware
    • juliendemarque
    • chancellorrr
    • adamhaney-invisible
    • nadeeminv
    • gtaltemann
    • elseagle
    • invisible-bot
    • rodrigo4244
    • scottdownes
    • zacksingh
    • el5091