[CalendarServer-changes] [7524] CalendarServer/trunk/contrib/performance/loadtest/sim.py

source_changes at macosforge.org source_changes at macosforge.org
Wed May 25 07:01:05 PDT 2011


Revision: 7524
          http://trac.macosforge.org/projects/calendarserver/changeset/7524
Author:   exarkun at twistedmatrix.com
Date:     2011-05-25 07:01:04 -0700 (Wed, 25 May 2011)
Log Message:
-----------
Only enable normal logging if the command line requests it

Modified Paths:
--------------
    CalendarServer/trunk/contrib/performance/loadtest/sim.py

Modified: CalendarServer/trunk/contrib/performance/loadtest/sim.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/sim.py	2011-05-25 13:56:31 UTC (rev 7523)
+++ CalendarServer/trunk/contrib/performance/loadtest/sim.py	2011-05-25 14:01:04 UTC (rev 7524)
@@ -15,7 +15,7 @@
 #
 ##
 
-from sys import argv, stderr
+from sys import argv, stdout
 from random import Random
 from plistlib import readPlist
 from collections import namedtuple
@@ -92,6 +92,17 @@
                 "--config %s: %s" % (path, str(e)))
 
 
+    def opt_logfile(self, filename):
+        """
+        Enable normal logging to some file.  - for stdout.
+        """
+        if filename == "-":
+            fObj = stdout
+        else:
+            fObj = file(filename, "a")
+        startLogging(fObj, setStdout=False)
+
+
     def opt_debug(self):
         """
         Enable Deferred and Failure debugging.
@@ -227,8 +238,6 @@
             addObserver(obs.observe)
             self.reactor.addSystemEventTrigger(
                 'before', 'shutdown', removeObserver, obs.observe)
-        # XXX Screws with the tests, need to make this conditional or something.
-        startLogging(stderr, setStdout=False)
         sim = self.createSimulator()
         arrivalPolicy = self.createArrivalPolicy()
         arrivalPolicy.run(sim)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110525/60c516e2/attachment.html>


More information about the calendarserver-changes mailing list