dpup/node-logg — pull request #4 by thanpolas (2013-04-13 23:40:27+00:00)
Title: Use event emitter and option to mute console

I wanted to close the console logging and solely rely on events emitted.

I had to use events.EventEmitter. The API's surface has not been altered, everything works as it used to. Additionally these new methods are exposed:

* `formatRecord(logRecord)` : return a logRecord formated (as it would print in console).
* `addConsole()` : Add back console logging if it was removed.
* `removeConsole()` : Remove console logging.
* `removeListener(event, function)` : Remove a listener added either by `on` or `registerWatcher` methods.
* `on(event, function)` : Direct access to events emitted by `rootLogger`.

Each logger instance exposes the full `events.EventEmitter` API as it inherits from it.

Events emitted in sequence:

1. If message is loggable emit on **global key** ( '' ) from rootLogger.
2. If not rootLogger emit **LEVEL** event on instance and bubble up to and including rootLogger.
3. If not rootLogger emit Logger **NAME** event on instance and bubble up to and including rootLogger.

Let me know if you are good with this and i'll update the docs.