[Zodb-checkins] CVS: ZODB3/zLOG - EventLogger.py:1.3

Guido van Rossum guido@python.org
Tue, 26 Nov 2002 11:38:03 -0500


Update of /cvs-repository/ZODB3/zLOG
In directory cvs.zope.org:/tmp/cvs-serv31669

Modified Files:
	EventLogger.py 
Log Message:
Rename the EventLogger instance to event_logger -- I don't like the
confusion caused by having the instance and the class have the same
name.


=== ZODB3/zLOG/EventLogger.py 1.2 => 1.3 ===
--- ZODB3/zLOG/EventLogger.py:1.2	Sun Nov 24 00:24:43 2002
+++ ZODB3/zLOG/EventLogger.py	Tue Nov 26 11:38:01 2002
@@ -33,7 +33,7 @@
     logger = logging.getLogger('event')
     logger.addHandler(NullHandler())
     log_format = '%(sev)s %(subsys)s %(summary)s%(detail)s'
-    
+
     def log(self, subsystem, severity, summary, detail, error):
         if error:
             kw = {'exc_info':1}
@@ -60,9 +60,9 @@
         severity = zlog_to_pep282_severity(severity)
         self.logger.log(severity, msg, **kw)
 
-EventLogger = EventLogger()
+event_logger = EventLogger()
 
-log_write = EventLogger.log
+log_write = event_logger.log
 
 def severity_string(severity, mapping={
     -300: 'TRACE',
@@ -101,7 +101,7 @@
         return logging.INFO
     else:
         return logging.DEBUG
-        
+
 def log_time():
     """Return a simple time string without spaces suitable for logging."""
     return ("%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d"
@@ -155,7 +155,7 @@
 def initialize_from_environment():
     """ Reinitialize the event logger from the environment """
     # clear the current handlers from the event logger
-    EventLogger.logger.handlers = []
+    event_logger.logger.handlers = []
 
     handlers = []
 
@@ -184,8 +184,7 @@
 
     severity = get_env_severity_info()
     severity = zlog_to_pep282_severity(severity)
-    EventLogger.logger.setLevel(severity)
+    event_logger.logger.setLevel(severity)
 
     for handler in handlers:
-        EventLogger.logger.addHandler(handler)
-
+        event_logger.logger.addHandler(handler)