var types           = require('./types'),
    levels          = types.levels,
    ConsoleHandler  = require('./handlers/console');

// Initial loading will register a console handler
// and any other defaults (handlers are mutable though).
var handlers_ = (function() {
  var ch    = new ConsoleHandler(),
      arr   = [];
  arr.push(ch);
  return arr;
})();

function setInterest(handlerName, level) {
  handlers_.forEach(function(obj, idx, arr) {
    if ( obj.getName() === handlerName ) {
      obj.interest = level;
    }
  });
}

function dispatch(level, args) {
  handlers_.forEach(function(obj, idx, arr) {
    obj.write(level, args);
  });
}

function debug() {
  dispatch(levels.DEBUG, Array.prototype.slice.call(arguments));
}

function info() {
  dispatch(levels.INFO, Array.prototype.slice.call(arguments));
}

function error() {
  dispatch(levels.ERROR, Array.prototype.slice.call(arguments));
}

function warn() {
  dispatch(levels.WARN, Array.prototype.slice.call(arguments));
}

function fail() {
  dispatch(levels.FAIL, Array.prototype.slice.call(arguments));
}

module.exports = {

  // Log handlers
  debug:    debug,
  info:     info,
  error:    error,
  warn:     warn,
  fail:     fail,

  // Set to filter only specified level or higher
  // for a given handler
  setInterest: setInterest,

  // Enumeration of levels for ease of use
  levels: levels
};

@@ -126,238 +126,590 @@
 le')
-;%0A%0A// Initial loading will register a console handler%0A// and any other defaults (handlers are mutable though).%0Avar handlers_ = (function() %7B%0A  var ch    = new ConsoleHandler(),%0A      arr   = %5B%5D;%0A  arr.push(ch);%0A  return arr;%0A%7D)();
+,%0A    errors          = require('./errordefs');%0A%0A%0Avar available_  = %7B%7D,%0A    handlers_;%0A%0A// Start with a console handler%0Ahandlers_ = (function() %7B%0A  var ch    = new ConsoleHandler(),%0A      arr   = %5B%5D;%0A  arr.push(ch);%0A  return arr;%0A%7D)();%0A%0Afunction removeHandler(name) %7B%0A  handlers_.forEach(function(obj, idx, arr) %7B%0A    if ( obj.getName() === name ) %7B%0A      arr.splice(idx, 1);%0A    %7D%0A  %7D);%0A%7D%0A%0Afunction addHandler(name) %7B%0A  var Constructor = available_%5Bname%5D %7C%7C undefined,%0A      handler;%0A%0A  if ( !Constructor ) %7B%0A    throw errors.UnknownError();%0A  %7D%0A  handler = new Constructor();%0A%0A%0A%0A%7D
 %0A%0Afu
@@ -1720,12 +1720,160 @@
 : levels
+,%0A%0A  // Add a new handler (type of output)%0A  addHandler: addHandler,%0A%0A  // Remove a handler (ie stop logging to file)%0A  removeHandler: removeHandler
 %0A%7D;%0A

Add ability to add/remove handlers.