summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-03-24 16:28:17 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-03-24 16:28:17 +0000
commit375d171c5c3ebe0129679231fdc98b9209c19605 (patch)
treec66de73695914dbeebe0152c0046665118f1397e
parent81d89d1964a0e438b5869bddaf324d906afb9f60 (diff)
downloadpykolab-375d171c5c3ebe0129679231fdc98b9209c19605.tar.gz
Add '-l' option for the loglevel
-rw-r--r--pykolab/logger.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/pykolab/logger.py b/pykolab/logger.py
index c8fb9ef..64cdc8d 100644
--- a/pykolab/logger.py
+++ b/pykolab/logger.py
@@ -39,9 +39,14 @@ class Logger(logging.Logger):
debuglevel = -1
continue
- #print inspect.stack()
- #print "debuglevel:", debuglevel
- #print "loglevel:", loglevel
+ if '-l' == arg:
+ loglevel = -1
+ continue
+ if loglevel == -1:
+ if hasattr(logging,arg.upper()):
+ loglevel = getattr(logging,arg.upper())
+ else:
+ loglevel = logging.DEBUG
def __init__(self, *args, **kw):
if kw.has_key('name'):