From: Leandro Lucarella Date: Mon, 16 Jun 2008 19:37:10 +0000 (-0300) Subject: Add logging to pymin.service module (refs #27). X-Git-Url: https://git.llucax.com/software/pymin.git/commitdiff_plain/ab619eb6bb706d95a3a9cfb48f3f8dc770ab599c?hp=12b7d86229346c68e653a51d1e6598a5973901ba Add logging to pymin.service module (refs #27). --- diff --git a/pymin/service/__init__.py b/pymin/service/__init__.py index 1828fb4..9de5b96 100644 --- a/pymin/service/__init__.py +++ b/pymin/service/__init__.py @@ -1,17 +1,22 @@ # vim: set encoding=utf-8 et sw=4 sts=4 : import imp +import logging ; log = logging.getLogger('pymin.service') class LoadError(ImportError): pass def load_service(name, search_paths): + log.debug('load_service(%s, %r)', name, search_paths) try: (fp, path, desc) = imp.find_module(name, search_paths) except ImportError: raise LoadError('module "%s" not found' % name) + log.debug('load_service() -> find_module() returned %r', (fp, path, desc)) try: + m = imp.load_module(name, fp, path, desc) + log.debug('load_service() -> loaded module %r', m) return imp.load_module(name, fp, path, desc) finally: if fp: