summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2008-06-25 18:43:42 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2008-07-15 12:28:53 +0200
commitd9a9fb74a0e5ae3cfc948608c9084036f49b57f4 (patch)
treecdce1272e7ae2afa696482c52f4c3e1a3af18c06 /src
parent4f6b2987ed33db74824b4cb2f91032f03ec7d26a (diff)
downloadnbb-d9a9fb74a0e5ae3cfc948608c9084036f49b57f4.tar.gz
nbb-d9a9fb74a0e5ae3cfc948608c9084036f49b57f4.tar.xz
nbb-d9a9fb74a0e5ae3cfc948608c9084036f49b57f4.zip
Add basic logging support
Diffstat (limited to 'src')
-rw-r--r--src/nbblib/bs.py6
-rw-r--r--src/nbblib/main.py6
-rw-r--r--src/nbblib/vcs.py6
3 files changed, 12 insertions, 6 deletions
diff --git a/src/nbblib/bs.py b/src/nbblib/bs.py
index aff1834..ac09b97 100644
--- a/src/nbblib/bs.py
+++ b/src/nbblib/bs.py
@@ -4,6 +4,8 @@
import os
+import logging
+
from nbblib.plugins import *
from nbblib.progutils import *
@@ -44,13 +46,13 @@ class BSSourceTree(object):
"""Find BS tree type and return it"""
if len(cls.plugins) < 1:
raise NoPluginsRegistered(cls)
- # print "CLASS", 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():
- # print "KLASS", klass
+ logging.debug("KLASS %s", klass)
matches[key] = t
except NotABSSourceTree, e:
pass
diff --git a/src/nbblib/main.py b/src/nbblib/main.py
index e9b20cd..2d432e4 100644
--- a/src/nbblib/main.py
+++ b/src/nbblib/main.py
@@ -113,6 +113,9 @@ Global options:
"""
+import logging
+
+
from nbblib.bs import *
from nbblib.commands import *
from nbblib.package import *
@@ -263,7 +266,8 @@ def main(argv):
def cmdmain(argv):
try:
main(argv)
+ logging.shutdown()
except CommandLineError, e:
+ logging.shutdown()
print e
sys.exit(2)
-
diff --git a/src/nbblib/vcs.py b/src/nbblib/vcs.py
index 38d04b5..91c36c5 100644
--- a/src/nbblib/vcs.py
+++ b/src/nbblib/vcs.py
@@ -1,7 +1,7 @@
import os
+import logging
import urlparse
-
from nbblib.package import *
from nbblib.plugins import *
from nbblib.progutils import *
@@ -74,13 +74,13 @@ class VCSourceTree(object):
"""Detect VCS tree type and return object representing it"""
if len(cls.plugins) < 1:
raise NoPluginsRegistered(cls)
- # print "CLASS", 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:
- # print "KLASS", klass
+ logging.debug("KLASS %s", klass)
matches[key] = t
except NotAVCSourceTree, e:
pass