[Opensrf-commits] r1085 - trunk/src/python/osrf

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Aug 19 09:59:11 EDT 2007


Author: erickson
Date: 2007-08-19 09:54:43 -0400 (Sun, 19 Aug 2007)
New Revision: 1085

Modified:
   trunk/src/python/osrf/log.py
Log:
adding thread name to the log output

Modified: trunk/src/python/osrf/log.py
===================================================================
--- trunk/src/python/osrf/log.py	2007-08-19 13:52:25 UTC (rev 1084)
+++ trunk/src/python/osrf/log.py	2007-08-19 13:54:43 UTC (rev 1085)
@@ -13,7 +13,7 @@
 # GNU General Public License for more details.
 # -----------------------------------------------------------------------
 
-import traceback, sys, os, re
+import traceback, sys, os, re, threading
 from osrf.const import *
 
 loglevel = 4
@@ -72,7 +72,7 @@
     # XXX when file logging is implemented, wrap io in a semaphore for thread safety
 
     file = frgx.sub('',tb[0])
-    msg = '[%s:%d:%s:%s] %s' % (lvl, os.getpid(), file, tb[1], msg)
+    msg = '[%s:%d:%s:%s:%s] %s' % (lvl, os.getpid(), file, tb[1], threading.currentThread().getName(), msg)
     syslog.syslog(slvl, msg)
 
     if level == OSRF_LOG_ERR:



More information about the opensrf-commits mailing list