Normal Programming Mistake
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    bunyan-adaptorpublic

    Bunyan Adaptor

    Maps the major Bunyan logging methods to custom methods. Useful for fitting your own logging system with a module expecting a Bunyan interface. For a simple console.log()/.error() mapping see Bunyan Duckling

    Installation

    npm install bunyan-adaptor --save

    Syntax

    var logger = bunyanAdaptor(options);

    Usage

    Simple:

    var logger = require('bunyan-adaptor')({
      log: console.log.bind(console),
      error: console.error.bind(console),
    });
     
    logger.error('Warning');      // Uses console.error()
    logger.info('Informational'); // Uses console.log()

    Options

    Maps options methods to all seven Bunyan log levels.

    • .fatal() – maps to options.fatal and fallbacks to options.error and options.log in that order
    • .error() – maps to options.error and fallbacks to options.error and options.log in that order
    • .warn() – maps to options.warn and fallbacks to options.log
    • .info() – maps to options.info and fallbacks to options.log
    • .debug() – maps to options.debug and fallbacks to options.verbose and options.log in that order
    • .trace() – maps to options.trace and fallbacks to options.verbose and options.log in that order

    options.log itself fallbacks to console.log()

    Keywords

    none

    install

    npm i bunyan-adaptor

    Downloadsweekly downloads

    486

    version

    1.1.0

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar