Skip to content

Commit

Permalink
edk2_invocable: verbose flag may not be honored (#575)
Browse files Browse the repository at this point in the history
A platform settings GetLoggingLevel() currently takes president over the `--Verbose` flag, but logically, a command flag should override the default behavior and set the logging level regardless of platform settings.
  • Loading branch information
Javagedes authored Dec 8, 2023
1 parent dc5b3cd commit 5919e90
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions edk2toolext/edk2_invocable.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,17 @@ def GetLoggingLevel(self, loggerType):
Returns:
(logging.Level): logging level
"""
if self.Verbose:
return logging.DEBUG

try:
level = self.PlatformSettings.GetLoggingLevel(loggerType)
if level is not None:
return level
except Exception:
pass

if (loggerType == "con") and not self.Verbose:
if loggerType == "con":
return logging.WARNING
return logging.DEBUG

Expand Down Expand Up @@ -456,7 +459,7 @@ def ParseCommandLineOptions(self):
parserObj.add_argument('--build-config', dest='build_config', default=default_build_config_path, type=str,
help='Provide shell variables in a file')
parserObj.add_argument('--verbose', '--VERBOSE', '-v', dest="verbose", action='store_true', default=False,
help='verbose')
help='Overrides platform settings and sets all loggers to verbose (logging.DEBUG).')

# set the epilog to display with --help, -h
parserObj.epilog = self.AddParserEpilog()
Expand Down

0 comments on commit 5919e90

Please sign in to comment.