[Python-checkins] python/dist/src/Lib/logging __init__.py, 1.26, 1.27

vsajip at users.sourceforge.net vsajip at users.sourceforge.net
Thu Mar 31 22:16:58 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib/logging
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20593

Modified Files:
	__init__.py 
Log Message:
Added threadName and now using re-entrant lock

Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/logging/__init__.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- __init__.py	13 Mar 2005 09:54:31 -0000	1.26
+++ __init__.py	31 Mar 2005 20:16:55 -0000	1.27
@@ -42,7 +42,7 @@
 __author__  = "Vinay Sajip <vinay_sajip at red-dove.com>"
 __status__  = "beta"
 __version__ = "0.4.9.6"
-__date__    = "12 March 2005"
+__date__    = "27 March 2005"
 
 #---------------------------------------------------------------------------
 #   Miscellaneous module data
@@ -241,8 +241,10 @@
         self.relativeCreated = (self.created - _startTime) * 1000
         if thread:
             self.thread = thread.get_ident()
+            self.threadName = threading.currentThread().getName()
         else:
             self.thread = None
+            self.threadName = None
         if hasattr(os, 'getpid'):
             self.process = os.getpid()
         else:
@@ -320,6 +322,7 @@
                         relative to the time the logging module was loaded
                         (typically at application startup time)
     %(thread)d          Thread ID (if available)
+    %(threadName)s      Thread name (if available)
     %(process)d         Process ID (if available)
     %(message)s         The result of record.getMessage(), computed just as
                         the record is emitted
@@ -570,7 +573,7 @@
         Acquire a thread lock for serializing access to the underlying I/O.
         """
         if thread:
-            self.lock = thread.allocate_lock()
+            self.lock = threading.RLock()
         else:
             self.lock = None
 



More information about the Python-checkins mailing list