subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r1297739 - /subversion/trunk/subversion/tests/cmdline/svntest/main.py
Date Tue, 06 Mar 2012 21:44:51 GMT
Author: gstein
Date: Tue Mar  6 21:44:51 2012
New Revision: 1297739

URL: http://svn.apache.org/viewvc?rev=1297739&view=rev
Log:
Add a timestamp to the log output.

* subversion/tests/cmdline/svntest/main.py:
  (...): create the handler, then add a Formatter to it with our new
    format, and then add the handler to the root logger.

Modified:
    subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1297739&r1=1297738&r2=1297739&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Tue Mar  6 21:44:51 2012
@@ -81,7 +81,12 @@ default_num_threads = 5
 
 # Set up logging
 logger = logging.getLogger()
-logger.addHandler(logging.StreamHandler(sys.stdout))
+handler = logging.StreamHandler(sys.stdout)
+formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s',
+                              '%Y-%m-%d %H:%M:%S')
+handler.setFormatter(formatter)
+logger.addHandler(handler)
+
 
 class SVNProcessTerminatedBySignal(Failure):
   "Exception raised if a spawned process segfaulted, aborted, etc."



Mime
View raw message