pazz/alot — Issue #231: Improve logging
Author: 0x64746b
Created: 2012-01-05 03:03:39+00:00
State: open

So far we mix logging through the module functions `logging.` and methods of logger instances. This is inconsistant, especially since instances get passed across some module boundaries while other modules don't get the instance and (supposedly therefore) use the module functions.

I suppose we stop passing around logger instances and remove all occurrences of calls to module functions. Instead, each module should get its own logger instance:

```
import logging

def __init__(self):
self.logger = logging.getLogger()

self.logger.debug("Using my own logger feelz guuud!")
```

This would bring the additional advantage of being able to uniformly specify a name (preferably the module name) when acquiring a logger:

```
self.logger = logging.getLogger(__name__)
```

This would replace the default logger name (`root`) in log messages with meaningful module names which would provide information on where the log message originated:

```
DEBUG:alot.init:Using my own logger feelz guuud!
```