egg-bog

1.0.2 • Public • Published

Build Status Coverage

egg-bog

Egg plugin for bog logger

Install

$ npm i egg-bog

Usage

// {app_root}/config/plugin.js
exports.bog = {
  enable: true,
  package: 'egg-bog',
}

config Object

// {app_root}/config/config.default.js
exports.bog = config
  • level BogLevel='info' the log level. Defaults to 'info'
  • includeTimeDesignator boolean=false bog.config().includeTimeDesignator
  • includeTimeZone boolean=false bog.config().includeTimeZone
  • on {[BogLevel]: Function} event handler for a certain log level
  • redirect {[BogLevel]: Function} override the default logger for a certain level
exports.bog = {
  on: {
    // It will be triggered when `bog.error(...args)`
    error (datetime, level, args) {
      sendToSentry(datetime, level, args)
    }
  }
}

LICENSE

MIT

Package Sidebar

Install

npm i egg-bog

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

5.64 kB

Total Files

6

Last publish

Collaborators

  • kael