diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-06-26 00:47:44 +0200 |
---|---|---|
committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-07-15 12:28:53 +0200 |
commit | 9a9987be67d8ac3cad703bcdd96e8c5966e809da (patch) | |
tree | d84be92229b0b20305e9dfe257a8214e81593291 /src | |
parent | d9a9fb74a0e5ae3cfc948608c9084036f49b57f4 (diff) | |
download | nbb-9a9987be67d8ac3cad703bcdd96e8c5966e809da.tar.gz nbb-9a9987be67d8ac3cad703bcdd96e8c5966e809da.tar.xz nbb-9a9987be67d8ac3cad703bcdd96e8c5966e809da.zip |
Introduce logging module
Diffstat (limited to 'src')
-rw-r--r-- | src/nbb.in | 13 | ||||
-rw-r--r-- | src/nbblib/bs.py | 4 | ||||
-rw-r--r-- | src/nbblib/vcs.py | 4 |
3 files changed, 17 insertions, 4 deletions
@@ -14,6 +14,19 @@ if sys.version_info < (2,4): print "Fatal: This program requires Python 2.4 or later." sys.exit(3) +import logging # since python 2.3 + +# funcName: Since python 2.5 +# format="%(filename)s:%(lineno)d:%(funcName)s:" +logging.basicConfig(level = logging.DEBUG, + format = "%(levelname)s: %(message)s", + stream = sys.stderr) +if False: + logging.debug("xxx debug") + logging.info("xxx info") + logging.warning("xxx warn") + logging.error("xxx error") + if __name__ == '__main__': pythondir = "@pythondir@" lib_found = False diff --git a/src/nbblib/bs.py b/src/nbblib/bs.py index ac09b97..70f4ee0 100644 --- a/src/nbblib/bs.py +++ b/src/nbblib/bs.py @@ -46,13 +46,13 @@ class BSSourceTree(object): """Find BS tree type and return it""" if len(cls.plugins) < 1: raise NoPluginsRegistered(cls) - logging.debug("CLASS %s", cls) + #logging.debug("CLASS %s", cls) matches = PluginDict() for key, klass in cls.plugins.iteritems(): try: t = klass(vcs_tree, context) if t.tree_root() == vcs_tree.tree_root(): - logging.debug("KLASS %s", klass) + #logging.debug("KLASS %s", klass) matches[key] = t except NotABSSourceTree, e: pass diff --git a/src/nbblib/vcs.py b/src/nbblib/vcs.py index 91c36c5..f9b7dd3 100644 --- a/src/nbblib/vcs.py +++ b/src/nbblib/vcs.py @@ -74,13 +74,13 @@ class VCSourceTree(object): """Detect VCS tree type and return object representing it""" if len(cls.plugins) < 1: raise NoPluginsRegistered(cls) - logging.debug("CLASS %s", cls) + #logging.debug("CLASS %s", cls) matches = PluginDict() for key, klass in cls.plugins.iteritems(): try: t = klass(srcdir, context) if t.tree_root() == srcdir: - logging.debug("KLASS %s", klass) + #logging.debug("KLASS %s", klass) matches[key] = t except NotAVCSourceTree, e: pass |