Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (33 sloc) 1.19 KB

eel-stream - EventEmitter logging -> writeable streams Build Status

An incredibly simple module for directing logs from eel to a writeable stream, just 6 lines:

module.exports = function (formatter, stream) {
	return function (entry) {
		var output = formatter(entry)
		if (!output) return
		stream.write(output + '\n')


Install it like this:

npm install eel-stream

Use it like this:

var fs  = require('fs')
var log = require('eel')
var stream = fs.createWriteStream(__dirname+'/myapp.log')
var handler = require('eel-stream')(JSON.stringify, stream)

log.on('entry', handler)

log('test1', {ok: true})
log.error('test2', {ok: false})

And get log entries like this in myapp.log:



  • formatter: A callback with the signature (entry) -> String|Buffer
  • stream: A writable stream