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

Unified Diff: build/android/pylib/cmd_helper.py

Issue 13799010: [Android] Reduce test logging verbosity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « build/android/pylib/base/shard.py ('k') | build/android/pylib/flag_changer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/cmd_helper.py
diff --git a/build/android/pylib/cmd_helper.py b/build/android/pylib/cmd_helper.py
index e9102411a6c71acdf85d3d7e7677ff7b5f18ecb1..daa4c71e783181ac8ce0d5ce4438fedd851905bd 100644
--- a/build/android/pylib/cmd_helper.py
+++ b/build/android/pylib/cmd_helper.py
@@ -6,6 +6,7 @@
import os
import logging
+import pipes
import signal
import subprocess
import tempfile
@@ -67,7 +68,20 @@ def GetCmdStatusAndOutput(args, cwd=None, shell=False):
Returns:
The tuple (exit code, output).
"""
- logging.info(str(args) + ' ' + (cwd or ''))
+ if isinstance(args, basestring):
+ args_repr = args
+ if not shell:
+ raise Exception('string args must be run with shell=True')
+ elif shell:
+ raise Exception('array args must be run with shell=False')
+ else:
+ args_repr = ' '.join(map(pipes.quote, args))
+
+ s = '[host]'
+ if cwd:
+ s += ':' + cwd
+ s += '> ' + args_repr
+ logging.info(s)
tmpout = tempfile.TemporaryFile(bufsize=0)
tmperr = tempfile.TemporaryFile(bufsize=0)
exit_code = _Call(args, cwd=cwd, stdout=tmpout, stderr=tmperr, shell=shell)
@@ -79,7 +93,9 @@ def GetCmdStatusAndOutput(args, cwd=None, shell=False):
tmpout.seek(0)
stdout = tmpout.read()
tmpout.close()
- logging.info(stdout[:4096]) # Truncate output longer than 4k.
+ if len(stdout) > 4096:
+ logging.debug('Truncated output:')
+ logging.debug(stdout[:4096])
return (exit_code, stdout)
« no previous file with comments | « build/android/pylib/base/shard.py ('k') | build/android/pylib/flag_changer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698