Package Exports
- debug-logfmt
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (debug-logfmt) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
debug-logfmt
Highlights
- Based on
debug, useDEBUGfor enable/disable logging. - Expose
info,warnanderrorlogging levels. - Format messages using Heroku logfmt syntax.
Install
$ npm install debug-logfmt --saveconst debug = require('debug-logfmt')
const log = debug('metascraper')
log.debug('retry', { url: req.url })
log.info('done', { time: ms('1 hour') })
log.warn('token expired', { timestamp: Date.now() })
log.error('whoops', { message: error.message })API
debug(env, [options])
env
Required
Type: string
The env variable name to use for enabling logging using DEBUG.
options
levels
Type: array
Default: ['debug', 'info', 'warn', 'error']
The log levels available.
License
debug-logfmt © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.
kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats