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

Unified Diff: net/tools/testserver/testserver.py

Issue 6404003: Silence testserver logs when tests are run in non-verbose mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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
« net/test/test_server.h ('K') | « net/test/test_server.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/testserver/testserver.py
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index 9bad8623e9f27b9a19306ba54b58036f2836f512..54b037a289b31049d6a94c4a6a371e40f4db79fa 100755
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -1388,8 +1388,11 @@ class FileMultiplexer:
def main(options, args):
logfile = open('testserver.log', 'w')
- sys.stdout = FileMultiplexer(sys.stdout, logfile)
sys.stderr = FileMultiplexer(sys.stderr, logfile)
+ if options.log_to_console:
+ sys.stdout = FileMultiplexer(sys.stdout, logfile)
+ else:
+ sys.stdout = logfile
port = options.port
@@ -1487,6 +1490,11 @@ if __name__ == '__main__':
const=SERVER_SYNC, default=SERVER_HTTP,
dest='server_type',
help='start up a sync server.')
+ option_parser.add_option('', '--log-to-console', action='store_const',
+ const=True, default=False,
+ dest='log_to_console',
+ help='Enables or disables sys.stdout logging to '
+ 'the console.')
option_parser.add_option('', '--port', default='0', type='int',
help='Port used by the server. If unspecified, the '
'server will listen on an ephemeral port.')
« net/test/test_server.h ('K') | « net/test/test_server.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698