ros-infrastructure/bloom — pull request #317 by mkoval (2014-10-04 00:54:15+00:00)
Title: Fixed exception when importing bloom.logging

There is incorrect exception-handling code in `bloom.logging` that throws an exception as soon as it is imported. This is a very annoying problem since `bloom.logging` is included in all of the command-line scripts.

The error looks like this:

$ bloom-generate
Traceback (most recent call last):
File "/usr/local/bin/bloom-generate", line 9, in
load_entry_point('bloom==0.5.12', 'console_scripts', 'bloom-generate')()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 339, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2457, in load_entry_point
return ep.load()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2171, in load
['__name__'])
File "/usr/local/lib/python2.7/dist-packages/bloom/commands/__init__.py", line 42, in
from bloom.commands.update import start_updater
File "/usr/local/lib/python2.7/dist-packages/bloom/commands/update.py", line 49, in
from bloom.logging import warning
File "/usr/local/lib/python2.7/dist-packages/bloom/logging.py", line 303, in
debug(str(exc.__name__) + ": " + str(exc))

This caused by a bug in how the error message is constructed: it uses `__name__` instead of `__class__.__name__`. This only happens if writing a file log fails, e.g. because the logging directory is not writable.