Created
July 5, 2016 07:38
-
-
Save mkozjak/b73e9b47be4bc9bd39d48e7029447e19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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