def load_log(self):
config_file = StringIO.StringIO()
self.config.write(config_file)
- x = config_file.getvalue()
logging.config.fileConfig(StringIO.StringIO(config_file.getvalue()))
# Don't attach the logger because it contains an unpicklable
# thread.lock. Instead, grab it directly every time you need it.
# License along with Hooke. If not, see
# <http://www.gnu.org/licenses/>.
-"""`pluggable`
+"""``pluggable`` provides utility functions for extensible plugin modules.
"""
+import logging
+
from ..compat.odict import odict
from .graph import Node, Graph
assert count > 0, 'No %s entries: %s' % (submodname, submodnames)
assert count == 1, 'Multiple (%d) %s entries: %s' \
% (count, submodname, submodnames)
- this_mod = __import__(this_modname, fromlist=[submodname])
+ try:
+ this_mod = __import__(this_modname, fromlist=[submodname])
+ except ImportError, e:
+ # Use the root logger because the 'hooke' logger is
+ # configured by a Hooke instance after module imports.
+ logging.warn('could not import %s from %s: %s'
+ % (submodname, this_modname, e))
+ continue
submod = getattr(this_mod, submodname)
yield (submodname, submod)