Skip to content

Instantly share code, notes, and snippets.

@mkozjak
Created July 5, 2016 07:38
Show Gist options
  • Save mkozjak/b73e9b47be4bc9bd39d48e7029447e19 to your computer and use it in GitHub Desktop.
Save mkozjak/b73e9b47be4bc9bd39d48e7029447e19 to your computer and use it in GitHub Desktop.
var bunyan = require('bunyan');
function InfoStream() {}
InfoStream.prototype.write = function(data) {
process.stdout.write("INFO: " + data)
}
function DebugStream() {}
DebugStream.prototype.write = function(data) {
process.stdout.write("DEBUG: " + data)
}
var log = bunyan.createLogger({
name: "logger1",
streams: [{
level: "info",
stream: new InfoStream()
}, {
level: "debug",
stream: new DebugStream()
}]
})
var log_default = bunyan.createLogger({
name: "logger2"
})
log.info("info me")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment