[rhmessaging-commits] rhmessaging commits: r3454 - mgmt/trunk/parsley/python/parsley.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Jun 17 13:58:36 EDT 2009


Author: justi9
Date: 2009-06-17 13:58:35 -0400 (Wed, 17 Jun 2009)
New Revision: 3454

Modified:
   mgmt/trunk/parsley/python/parsley/loggingex.py
Log:
Make this work with python 2.6

Modified: mgmt/trunk/parsley/python/parsley/loggingex.py
===================================================================
--- mgmt/trunk/parsley/python/parsley/loggingex.py	2009-06-17 13:43:53 UTC (rev 3453)
+++ mgmt/trunk/parsley/python/parsley/loggingex.py	2009-06-17 17:58:35 UTC (rev 3454)
@@ -1,11 +1,11 @@
-from logging import *
+import logging
 
 levels = {
-    "debug": DEBUG,
-    "info": INFO,
-    "warn": WARN,
-    "error": ERROR,
-    "critical": CRITICAL
+    "debug": logging.DEBUG,
+    "info": logging.INFO,
+    "warn": logging.WARN,
+    "error": logging.ERROR,
+    "critical": logging.CRITICAL
     }
 
 def enable_logging(name, level, file):
@@ -18,11 +18,11 @@
     if type(file) is str:
         file = open(file, "a")
 
-    handler = StreamHandler(file)
+    handler = logging.StreamHandler(file)
 
     fmt = "%(process)d %(asctime)s %(levelname)s %(message)s"
-    handler.setFormatter(Formatter(fmt))
+    handler.setFormatter(logging.Formatter(fmt))
 
-    log = getLogger(name)
+    log = logging.getLogger(name)
     log.addHandler(handler)
     log.setLevel(level)




More information about the rhmessaging-commits mailing list