diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2021-04-20 16:10:00 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-21 01:53:25 +0000 |
commit | 6a6eeaee10e3dfc122f16b8f067d1a302393e64e (patch) | |
tree | dd79320cb73bdb6b99fe0b95ccb40fd819cad004 /zephyr/zmake | |
parent | 85704376021f00246f31a847b7784b1ba8bb4b97 (diff) | |
download | chrome-ec-6a6eeaee10e3dfc122f16b8f067d1a302393e64e.tar.gz |
zephyr: zmake: enable verbose logging with --debug
The --debug parameter (which is passed in the CQ, since we want to see
as much failure context as we can in the logs) currently prevents
disabling tracebacks.
We had some discussion when that landed about making it enable verbose
logging as well. Make the default with --debug as DEBUG instead of
WARNING.
BUG=none
BRANCH=none
TEST=zmake -D testall => observed log level is DEBUG
zmake testall => observed log level is WARNING
zmake -l INFO testall => observed log level is INFO
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I87bf1d7cca34cffd9ff6deeb53fecf0ae8f2e362
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842364
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr/zmake')
-rw-r--r-- | zephyr/zmake/zmake/__main__.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/zephyr/zmake/zmake/__main__.py b/zephyr/zmake/zmake/__main__.py index 78a9cf4d65..aaede0b4f0 100644 --- a/zephyr/zmake/zmake/__main__.py +++ b/zephyr/zmake/zmake/__main__.py @@ -59,11 +59,11 @@ def main(argv=None): parser.add_argument('--checkout', type=pathlib.Path, help='Path to ChromiumOS checkout') parser.add_argument('-D', '--debug', action='store_true', default=False, - help='Turn on zmake debugging (e.g. stack trace)') + help=('Turn on debug features (e.g., stack trace, ' + 'verbose logging)')) parser.add_argument('-j', '--jobs', type=int, help='Degree of multiprogramming to use') parser.add_argument('-l', '--log-level', choices=list(log_level_map.keys()), - default='WARNING', dest='log_level', help='Set the logging level (default=WARNING)') parser.add_argument('-L', '--no-log-label', action='store_true', @@ -125,7 +125,13 @@ def main(argv=None): log_format = '%(message)s' else: log_format = '%(asctime)s - %(name)s/%(levelname)s: %(message)s' - logging.basicConfig(format=log_format, level=log_level_map.get(opts.log_level)) + + log_level = logging.WARNING + if opts.log_level: + log_level = log_level_map[opts.log_level] + elif opts.debug: + log_level = logging.DEBUG + logging.basicConfig(format=log_format, level=log_level) if not opts.debug: sys.tracebacklimit = 0 |