* Include _ansistrm.py, which was released under new BSD license separately in
a github gist as well as in the Python logutils module. Instead of setting
up a src/includes/ directory, I have included this file in the currently
flat module directory, because dealing with submodule imports in Python2.x
is a pain. I'm not sure if this will cause problems for Debian packaging,
but it could be changed later if so. The full text of the original license
and copyright has been retained at the head of _ansistrm.py, clearly
demarcated from python-gnupg's license and copyright info. The author of
_ansistrm.py is the same as the current upstream maintainer for
python-gnupg, Vinay Sajip, and I don't see why this person doesn't include
_ansistrm.py in all of their packages, because it is making skimming the
test logs for errors much faster.
* Add _logger.py, which contains a class decorator:
@wraps(logging.Logger)
def create_logger(level=logging.NOTSET)
[...]
which autoconfigures logging functionality. By default, logging.NullHandler
is still used, so there are no logs (neither logfiles nor piped to
stdout). If _logger.create_logger() is called with either a LEVEL attribute
from the logging module, or the integer equivalent, it will initialise
logging to stdout only. In the unittest suite, extra log handling
functionality is added to also write to a datetime-stamped logfile in the
tests/ directory.
* Change all "logger.<level>" statements to "log.<level>" and add new ones for
debugging and user information purposes.
* Remove the import of the python standard utilities logging module from:
src/gnupg.py
src/parsers.py
src/util.py
and switch to setting a top-level attribute, util.log, which is the returned
class from _logger.create_logger(). Everything else now does "from util
import log".