seanmonstar/Shipyard — Issue #18: Log utility
Author: seanmonstar
Created: 2012-01-27 21:07:39+00:00
State: open
Labels: proposal

`shipyard/utils/log` should let an application developer define some logging settings, like [Python's logging](http://docs.python.org/howto/logging.html#configuring-logging).

- `log.getLogger(name)` would prepend the name to the log statement.
- `log.setHandler(handlerClass)` would provide a way to pipe log messages to various locations, like `console.log`, a file, or an XHR request. A handler also can have a logging level, so that, for instance, XHRHandler would only receive logs from `log.error`.
- `log.setFormatter(formatterClass)` _optional_ - could define how logs are formatted. Perhaps `log.exception` for the `ConsoleHandler` would only show the error message, but `XHRHandler` would send the stack trace with it.

/cc @pennyfx @zalun @csuwldcat