commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r9793 - trunk/gnue-common/src/apps


From: johannes
Subject: [gnue] r9793 - trunk/gnue-common/src/apps
Date: Wed, 7 Nov 2007 02:31:53 -0600 (CST)

Author: johannes
Date: 2007-11-07 02:31:52 -0600 (Wed, 07 Nov 2007)
New Revision: 9793

Modified:
   trunk/gnue-common/src/apps/GDebug.py
Log:
Remove default error handler, when loggin into debug-file as requested 
on the commandline


Modified: trunk/gnue-common/src/apps/GDebug.py
===================================================================
--- trunk/gnue-common/src/apps/GDebug.py        2007-10-02 13:57:46 UTC (rev 
9792)
+++ trunk/gnue-common/src/apps/GDebug.py        2007-11-07 08:31:52 UTC (rev 
9793)
@@ -229,6 +229,12 @@
         __builtin__.__dict__ ['gLeave'] = gLeave
 
         if file is not None:
+            # If the user requested a debug-file on the command line, first
+            # make sure to get rid of all previously installed handlers
+            rlg = logging.getLogger('')
+            while rlg.handlers:
+                rlg.removeHandler(rlg.handlers[0])
+
             lgr = logging.getLogger('gnue')
             fmt = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
             hnd = logging.FileHandler(file, 'a+')





reply via email to

[Prev in Thread] Current Thread [Next in Thread]