0.0.4 • Published 11 years ago
organic-bunyan-output v0.0.4
oragnic-bunyan-output
Organelle which captures chemicals and transforms them to bunyan method calls.
Chemicals are expected to have at least the following structure:
{
method: String, // one of the following: "log", "debug", "error", "warn", "info", "trace"
arguments: Array[ Mixed ]
}Once chemical is captured it is used to invoke one of the methods of bunyan instance calling it with given arguments.
Note: Chemicals with method property having value of log invoke info method of bunayn.
dna
{
"reactOn": String,
"bunyan": {
// ... bunyan options
},
"bunyanInit": "process/cwd/relative/path/to/init/script.js" // optional
}Note: bunyan options stream & streams[ {stream: value} ] having string values process.stdout or process.stderr are referenced as respective process object streams.
sync bunyanInit script
module.exports = function(plasma, dna) {
return require("bunyan").createLogger(/* ... */)
}async bunyanInit script
module.exports = function(plasma, dna, next) {
next(null, require("bunyan").createLogger(/* ... */) )
}