Skip to content

Instantly share code, notes, and snippets.

@gigonaut
Created November 23, 2014 23:19
Show Gist options
  • Save gigonaut/4bfccbec9b44b1b59302 to your computer and use it in GitHub Desktop.
Save gigonaut/4bfccbec9b44b1b59302 to your computer and use it in GitHub Desktop.
var bunyan = require('bunyan');
var Stache = require('mustache');
var formatter = function(data) {
var str = "";
str += '-_-_-_-_-_-_-_,------, \n';
str += '_-_-_-_-_-_-_-| /\\_/\\\n';
str += '-_-_-_-_-_-_-~|__( ^ .^) \n';
str += '_-_-_-_-_-_-_-"" "" \n';
str += "message(the real honest to goodness message: " + data.msg + ")\n";
return str;
};
var mustacheFormatter = function(data) {
return Stache.render("<h1>{{msg}}</h1>", data);
};
var log = bunyan.createLogger({
name: "foo",
streams: [
{
stream: process.stderr,
level: "debug",
format: formatter
},
{
stream: process.stderr,
level: "debug",
format: mustacheFormatter
}
]
});
log.info('fun');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment