2.1.0 • Published 10 years ago

bole-stream v2.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

bole-stream

NPM version build status Test coverage Downloads js-standard-style

Stream data into a bole logger. Allows fine grained control over what is logged from a stream. Works exceptionally well in conjunction with http-ndjson.

Installation

$ npm install bole-stream

Usage

const boleStream = require('bole-stream')
const httpNdjson = require('http-ndjson')
const bole = require('bole')
const http = require('http')

bole.output({ level: 'info', stream: process.stdout })

http.createServer((req, res) => {
  httpNdjson(req, res).pipe(boleStream({ level: 'info' }))
  res.end()
}).listen()

API

writeStream = boleStream(opts)

Create a new Bole writestream. opts can contain the following values:

  • name: the default log name (defaults to bole)
  • level: the log level. Can be one of debug, info, warn and error

boleStream.obj(opts)

{ objectMode: true } shorthand.

writeStream.destroy(err?)

Close the stream manually.

See Also

License

MIT

2.1.0

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago