node-bunyan-lite/hi.js

26 lines
572 B
JavaScript
Raw Normal View History

2012-01-30 06:26:47 +00:00
var Logger = require('./lib/bunyan');
2012-01-30 20:01:15 +00:00
2012-01-30 06:26:47 +00:00
var log = new Logger({facility: "myapp", level: "info"});
console.log("log.info() is:", log.info())
log.info("hi");
log.info("hi", "trent");
log.info("hi %s there", true);
log.info({foo:"bar"}, "hi %d", 1, "two", 3);
console.log("\n--\n")
2012-01-30 20:01:15 +00:00
function Wuzzle(options) {
this.log = options.log;
this.log.info("creating a wuzzle")
}
Wuzzle.prototype.woos = function () {
2012-01-30 20:40:57 +00:00
this.log.warn("This wuzzle is woosey.")
2012-01-30 20:01:15 +00:00
}
var wuzzle = new Wuzzle({log: log.clone({component: "wuzzle"})});
wuzzle.woos();
log.info("done with the wuzzle")
2012-01-30 06:26:47 +00:00