[rhmessaging-commits] rhmessaging commits: r2072 - mgmt/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue May 20 17:53:06 EDT 2008


Author: justi9
Date: 2008-05-20 17:53:06 -0400 (Tue, 20 May 2008)
New Revision: 2072

Modified:
   mgmt/cumin/python/cumin/__init__.py
Log:
Don't log to the console at all unless we're in debug mode; remove a print_exc

Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py	2008-05-20 21:10:58 UTC (rev 2071)
+++ mgmt/cumin/python/cumin/__init__.py	2008-05-20 21:53:06 UTC (rev 2072)
@@ -81,8 +81,8 @@
     def run(self):
         try:
             self.do_run()
-        except:
-            print_exc()
+        except Exception, e:
+            log.exception(e)
 
     def do_run(self):
         while True:
@@ -100,6 +100,8 @@
                     elif attempts % 100 == 0:
                         reg.connect(self.model.data)
 
+                    raise Exception("Testing!")
+
             self.event.wait(10)
 
 class CuminServer(WebServer):
@@ -176,9 +178,10 @@
         self.load_args(sys.argv)
         root.removeHandler(h)
 
-        h = logging.StreamHandler()
-        h.setLevel(self.debug and logging.DEBUG or logging.ERROR)
-        root.addHandler(h)
+        if self.debug:
+            h = logging.StreamHandler()
+            h.setLevel(logging.DEBUG)
+            root.addHandler(h)
 
         try:
             h = logging.FileHandler(self.log)




More information about the rhmessaging-commits mailing list