JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 124926
  • Score
    100M100P100Q161993F
  • License MIT

debug module using logfmt format

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, use DEBUG for enable/disable logging.
  • Expose info, warn and error logging levels.
  • Format messages using Heroku logfmt syntax.

Install

$ npm install debug-logfmt --save
const 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