diff MoinMoin/server/__init__.py @ 3107:c6e39279f83b

refactor logging usage
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 23 Feb 2008 22:59:30 +0100
parents 80e1a910a2f1
children 4cd113328476
line wrap: on
line diff
--- a/MoinMoin/server/__init__.py	Sat Feb 23 21:45:02 2008 +0100
+++ b/MoinMoin/server/__init__.py	Sat Feb 23 22:59:30 2008 +0100
@@ -20,13 +20,19 @@
    fileConfig(StringIO(conf), defaults)
 
 def getLogger(name):
+    # do we want to strip MoinMoin. from the name?
+    #if name.startswith('MoinMoin.'):
+    #    name = name[9:]
     logger = _logging.getLogger(name)
     for levelnumber, levelname in _logging._levelNames.items():
         if isinstance(levelnumber, int): # that list has also the reverse mapping...
             setattr(logger, levelname, levelnumber)
     return logger
 
-logging = getLogger('')
+logging = getLogger(__name__)
+
+# use this to temporarily and selectively enable debug logging for this module
+#logging.setLevel(logging.DEBUG)
 
 def switchUID(uid, gid):
     """ Switch identity to safe user and group