wbond/sublime_package_control — pull request #446 by blopker (2013-05-17 03:12:04+00:00)
Title: Testing Pythonic logging refactor.

Hello, I was looking over the shiny new code for ST3 and noticed it wasn't using Python's logging module. I did a partial implementation to see if this is something worth pursuing.

The advantage here is that we can remove all the `if debug:` statements and we no longer have to pass a debug boolean around (`def read_package_file(package, relative_path, binary=False, debug=False):`).

Now we just need to stick a:
```python
from . import logger
log = logger.get(__name__)
```
at the top of any module we want logging for.

Calling `log.debug(msg)` will only print when `debug: true` in the preferences file. Also, if debug is enabled we can print out extra info, like what module the log originated from.

It opens up a whole world of logging fun (http://docs.python.org/2.6/library/logging.html) as well, but the basics are good for now.

If this is something you want I'll go ahead and remove the `console_write` module and fully integrate the new logging mechanism then send another PR.

Cheers!