Narnia's Psychedelic Mushrooms
Learn how companies like Phone2Action are using npm in their front-end developmentJoin the conversation »

debug-logfmt

1.0.4 • Public • Published

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

Install

npm i debug-logfmt

DownloadsWeekly Downloads

3,371

Version

1.0.4

License

MIT

Unpacked Size

6.54 kB

Total Files

5

Last publish

Collaborators

  • avatar