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

svn at svn.open-ils.org svn at svn.open-ils.org
Sun May 18 18:18:03 EDT 2008


Author: erickson
Date: 2008-05-18 18:17:59 -0400 (Sun, 18 May 2008)
New Revision: 1327

Modified:
   trunk/src/python/osrf/log.py
Log:
added date/time info when logging to a local file

Modified: trunk/src/python/osrf/log.py
===================================================================
--- trunk/src/python/osrf/log.py	2008-05-18 13:27:36 UTC (rev 1326)
+++ trunk/src/python/osrf/log.py	2008-05-18 22:17:59 UTC (rev 1327)
@@ -148,6 +148,8 @@
 
     global LOG_TYPE
 
+    timestamp = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
+
     logfile = None
     try:
         logfile = open(LOG_FILE, 'a')
@@ -157,7 +159,7 @@
         return
     try:
         LOG_SEMAPHORE.acquire()
-        logfile.write("%s\n" % msg)
+        logfile.write("%s %s\n" % (timestamp, msg))
     finally:
         LOG_SEMAPHORE.release()
         



More information about the opensrf-commits mailing list