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

Unified Diff: chrome/test/pyautolib/pyauto.py

Issue 2826014: Allow for a new flag (--log_file) which lets pyauto log to a file instead of ... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/pyauto.py
===================================================================
--- chrome/test/pyautolib/pyauto.py (revision 50541)
+++ chrome/test/pyautolib/pyauto.py (working copy)
@@ -664,6 +664,9 @@
'-v', '--verbose', action='store_true', default=False,
help='Make PyAuto verbose.')
parser.add_option(
+ '', '--log-file', type='string', default=None,
+ help='Provide a path to a file to which the logger will log')
+ parser.add_option(
'-D', '--wait-for-debugger', action='store_true', default=False,
help='Block PyAuto on startup for attaching debugger.')
parser.add_option(
@@ -682,10 +685,17 @@
self._options, self._args = parser.parse_args()
- # Setup logging
+ # Setup logging - start with defaults
+ level = logging.WARNING
+ format = None
+
if self._options.verbose:
- logging.basicConfig(level=logging.DEBUG,
- format='%(asctime)s %(levelname)-8s %(message)s')
+ level=logging.DEBUG
+ format='%(asctime)s %(levelname)-8s %(message)s'
+
+ logging.basicConfig(level=level, format=format,
+ filename=self._options.log_file)
+
if self._options.list_missing_tests:
self._ListMissingTests()
sys.exit(0)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698