Skip to content

Commit

Permalink
OverrideValidation: Update logging levels (#450)
Browse files Browse the repository at this point in the history
## Description
In scenarios where multiple track tags exist for a single library, only
one tag will match; previous logic would report this mismatch at a
logging.INFO level, which lead to developer confusion, thinking that
something needed to be fixed.

The logging level has been updated to logging.DEBUG for these messages.
errors are still properly reported when all tags do not match.

the RunCmd for returning the git commit has also been updated to
logging.DEBUG to reduce spam in the log as the commit hash returned from
the command is always printed later.

closes #361

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Passing CI

## Integration Instructions

N/A
  • Loading branch information
Javagedes authored Jun 14, 2023
1 parent 7951ca0 commit 8c81dc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions BaseTools/Plugin/OverrideValidation/OverrideValidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def override_process_line_with_version1(self, thebuilder, filelist, OverrideEntr
if tagtype == 'override':
logging.error(pnt_str)
else:
logging.info(pnt_str)
logging.debug(pnt_str) # MU_CHANGE

# Step 7: Do depth-first-search for cascaded modules
m_result = self.override_detect_process(thebuilder, fullpath, filelist, m_node, status)
Expand Down Expand Up @@ -539,7 +539,7 @@ def ModuleGitPatch(path, git_hash):
GitOutput = io.StringIO()
# TODO - let this go to console so we get colors
path_dir = os.path.dirname(path)
ret = RunCmd("git", f"diff {git_hash} {path}", workingdir=path_dir, outstream=GitOutput)
ret = RunCmd("git", f"diff {git_hash} {path}", workingdir=path_dir, outstream=GitOutput, logging_level=logging.DEBUG) # MU_CHANGE
if ret != 0:
return ""
GitOutput.seek(0)
Expand All @@ -552,7 +552,7 @@ def ModuleGitHash(path):
''' gets the current git hash of the given directory that path is '''
abspath_dir = os.path.dirname(os.path.abspath(path))
git_stream = StringIO()
ret = RunCmd("git", "rev-parse --verify HEAD", workingdir=abspath_dir, outstream=git_stream)
ret = RunCmd("git", "rev-parse --verify HEAD", workingdir=abspath_dir, outstream=git_stream, logging_level=logging.DEBUG) # MU_CHANGE
if ret != 0:
return None
git_stream.seek(0)
Expand Down

0 comments on commit 8c81dc2

Please sign in to comment.