Why do you need the init()? Why not...

// log.js
// just export an instance. done.
export = require("bunyan")();

// In some other file...
var log = require("log");
log.info("blah blah blah");

(this suggestion is untested)
Well, the logger was just a generalized demo of the concept. I do the same
thing for connections to cassandra, redis, etc. In the specific case of the
logger, the initialization sets up a zeromq stream for the logs and
specific messages, and also for stats and things.

Something I've been looking for is a guide of bad practices. There are a
bunch about good practices and conventions, but when straying from those,
you don't want to come to the realization later on that... "I've made a
huge mistake..."

Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group at

You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 13 of 18 | next ›
Discussion Overview
groupnodejs @
postedMar 22, '13 at 5:50a
activeMar 25, '13 at 10:27a



site design / logo © 2022 Grokbase