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

[email protected]
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
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+')
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.