Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Unified Diff: media/tools/constrained_network_server/cns.py

Issue 10825051: Update CNS to run on chromeperf34 and CNS tests to run on windows perf_av bot. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/tools/constrained_network_server/cns.py
diff --git a/media/tools/constrained_network_server/cns.py b/media/tools/constrained_network_server/cns.py
index cf2257f60b5a824b267eefdfb7ec00d4bf67b0a1..4a67d497e589bd8a4073f0e3e7021125edb59851 100755
--- a/media/tools/constrained_network_server/cns.py
+++ b/media/tools/constrained_network_server/cns.py
@@ -13,6 +13,7 @@ TODO(dalecurtis): Add some more docs here.
"""
import logging
+from logging import handlers
DaleCurtis 2012/07/27 00:49:43 What does gpylint say about the ordering here?
shadi 2012/07/27 01:06:25 I did check gpylint, this is actually its recommen
import mimetypes
import optparse
import os
@@ -321,22 +322,22 @@ def ParseArgs():
# Convert the path to an absolute to remove any . or ..
options.www_root = os.path.abspath(options.www_root)
- # Required so that cherrypy logs do not get propagated to root logger causing
- # the logs to be printed twice.
- cherrypy.log.error_log.propagate = False
- cherrypy.log.access_log.propagate = False
-
_SetLogger(options.verbose)
return options
def _SetLogger(verbose):
- # Logging is used for traffic_control debug statements.
+ file_handler = handlers.RotatingFileHandler('cns.log', 'a', 10000000, 1000)
DaleCurtis 2012/07/27 00:49:43 How will we see the logs on Linux now?
shadi 2012/07/27 01:06:25 It should show as it currently does since locally
+ file_handler.setFormatter(logging.Formatter('[%(threadName)s] %(message)s'))
+
log_level = _DEFAULT_LOG_LEVEL
if verbose:
log_level = logging.DEBUG
- logging.basicConfig(level=log_level, format='[%(threadName)s] %(message)s')
+ file_handler.setLevel(log_level)
+
+ cherrypy.log.error_log.addHandler(file_handler)
+ cherrypy.log.access_log.addHandler(file_handler)
def Main():

Powered by Google App Engine
This is Rietveld 408576698