mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-05-08 03:49:28 +00:00
Make git trace2 logging errors conditional on verbose mode.
Add a verbose attribute to the EventLog class, defaulting to False. Error messages printed to sys.stderr within the EventLog.Write method are now guarded by this verbose flag. In main.py, set EventLog.verbose to True if the command-line --verbose option is used. This prevents trace2 logging failures from being printed to stderr unless verbose output is explicitly requested. PROMPT=convert all git trace2 logging print messages to verbose only logging BUG: b/479811034 Change-Id: I8757ee52117d766f2f3ec47856db64cc4f51143c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/547542 Tested-by: Sam Saccone <samccone@google.com> Reviewed-by: Julia Tuttle <juliatuttle@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
This commit is contained in:
@@ -337,6 +337,9 @@ class _Repo:
|
||||
)
|
||||
return 1
|
||||
|
||||
cmd.CommonValidateOptions(copts, cargs)
|
||||
git_trace2_event_log.verbose = copts.verbose
|
||||
|
||||
if gopts.pager is not False and not isinstance(cmd, InteractiveCommand):
|
||||
config = cmd.client.globalConfig
|
||||
if gopts.pager:
|
||||
@@ -359,7 +362,6 @@ class _Repo:
|
||||
Execute the subcommand.
|
||||
"""
|
||||
nonlocal result
|
||||
cmd.CommonValidateOptions(copts, cargs)
|
||||
cmd.ValidateOptions(copts, cargs)
|
||||
|
||||
this_manifest_only = copts.this_manifest_only
|
||||
|
||||
Reference in New Issue
Block a user