From: erickson Date: Sun, 19 Aug 2007 13:54:43 +0000 (+0000) Subject: adding thread name to the log output X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a35cd8ff9277153586fb016f3596e6755da46946;p=opensrf%2Fbjwebb.git adding thread name to the log output git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1085 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/python/osrf/log.py b/src/python/osrf/log.py index 9ba9a12..df63093 100644 --- a/src/python/osrf/log.py +++ b/src/python/osrf/log.py @@ -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 @@ def __osrfLog(level, msg): # 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: