node-d3ck-log

0.4.3 • Public • Published

npm Version JS-Standard Build Status Dependency Status

node-d3ck-log

Lightweight wrapper and utilities for the node.js bunyan logger

Please note the major version of this module: Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable..

Features

  • Initializes a preconfigured (STDOUT / info) node-bunyan logger (sharable across the whole application)
  • Supports stream and log level changing via utility functions
  • No extra module dependencies except node-bunyan
  • Well documented (readme, manual and API reference)

Installation

npm install node-d3ck-log

Usage

var log = require('node-d3ck-log')
var logutil = require('node-d3ck-log/util')
var logLevel = log.level()                         // returns 30 (info)
log.info('An info message')                        // logs to STDOUT
log.level('trace')                                 // sets log level to 10 (trace)
log.trace('A trace message')                       // logs to STDOUT
var stdoutStream = logutil.getStdoutStream('trace')  // get STDOUT-trace stream
var stderrStream = logutil.getStderrStream('trace')  // get STDERR-trace stream
logutil.setStreams([stdoutStream, stderrStream])   // sets streams to STDOUT and STDERR
log.trace('A trace message')                       // logs to STDOUT and STDERR

Documentation

See also / Credits

Package Sidebar

Install

npm i node-d3ck-log

Weekly Downloads

0

Version

0.4.3

License

MIT

Last publish

Collaborators

  • d3ck.org