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

Unified Diff: chrome/test/kasko/py/kasko/config.py

Issue 1834773002: Add a JSON logging handler to the Kasko integration tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | chrome/test/kasko/py/kasko/json_logging_handler.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/kasko/py/kasko/config.py
diff --git a/chrome/test/kasko/py/kasko/config.py b/chrome/test/kasko/py/kasko/config.py
index d572e7117264c1bce16a8d6d9e3c9a62ebaa0bc1..361d20ad0a1fc8cd1b6b78658afd3bcb2cf1f610 100755
--- a/chrome/test/kasko/py/kasko/config.py
+++ b/chrome/test/kasko/py/kasko/config.py
@@ -10,6 +10,7 @@ import os
import optparse
from kasko.process import ImportSelenium
+from kasko.json_logging_handler import JSONLoggingHandler
_LOGGER = logging.getLogger(os.path.basename(__file__))
@@ -46,6 +47,9 @@ def GenerateOptionParser():
help='Specifies the directory where the python installation of webdriver '
'(selenium) can be found. Specify an empty string to use the system '
'installation. Defaults to $SRC/third_party/webdriver/pylib')
+ option_parser.add_option('--log-to-json', type='string',
+ help='The path to the JSON file that should be used for the logging. '
+ 'Defaults to logging directly to the console.')
return option_parser
@@ -76,6 +80,9 @@ def ParseCommandLine(option_parser=None):
# Configure logging.
logging.basicConfig(level=options.log_level)
+ if options.log_to_json:
+ logging.getLogger().addHandler(JSONLoggingHandler(options.log_to_json))
+
_LOGGER.debug('Using chrome path: %s', options.chrome)
_LOGGER.debug('Using chromedriver path: %s', options.chromedriver)
_LOGGER.debug('Using webdriver path: %s', options.webdriver)
« no previous file with comments | « no previous file | chrome/test/kasko/py/kasko/json_logging_handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698