Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(logger): Make logger less verbose #1295

Merged
merged 7 commits into from
Aug 4, 2021

Conversation

BreadGenie
Copy link
Contributor

Fix #1293

I have covered the contents in the issue and I'm now looking for other improvements.

@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2021

Codecov Report

Merging #1295 (4908758) into main (2d69f84) will increase coverage by 1.37%.
The diff coverage is 88.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1295      +/-   ##
==========================================
+ Coverage   78.96%   80.33%   +1.37%     
==========================================
  Files         262      264       +2     
  Lines        4801     4805       +4     
  Branches      578      577       -1     
==========================================
+ Hits         3791     3860      +69     
+ Misses        856      797      -59     
+ Partials      154      148       -6     
Flag Coverage Δ
longtests 80.33% <88.23%> (+1.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cve_bin_tool/version.py 68.42% <0.00%> (-1.58%) ⬇️
cve_bin_tool/cvedb.py 83.03% <80.00%> (+0.60%) ⬆️
cve_bin_tool/cve_scanner.py 76.61% <100.00%> (-0.74%) ⬇️
cve_bin_tool/version_scanner.py 77.30% <100.00%> (+1.41%) ⬆️
test/test_cli.py 93.10% <100.00%> (+11.82%) ⬆️
cve_bin_tool/async_utils.py 91.66% <0.00%> (-2.09%) ⬇️
cve_bin_tool/checkers/__init__.py 95.45% <0.00%> (ø)
test/test_data/pigz.py 100.00% <0.00%> (ø)
cve_bin_tool/checkers/pigz.py 100.00% <0.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d69f84...4908758. Read the comment docs.

@anthonyharrison
Copy link
Contributor

@BreadGenie Added some more suggestions to #1293

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking pretty good, but I've got a few requests.

cve_bin_tool/cve_scanner.py Outdated Show resolved Hide resolved
cve_bin_tool/cve_scanner.py Outdated Show resolved Hide resolved
@@ -252,7 +252,9 @@ async def refresh(self):
os.makedirs(self.cachedir)
# check for the latest version
if self.version_check:
self.LOGGER.info("Checking if there is a newer version.")
self.LOGGER.info(
f"cve-bin-tool is running {VERSION}. Checking if there is a newer version."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's put

    self.LOGGER.info(f"CVE Binary Tool version {VERSION}")

above line 254 so it prints the version even if the version check is disabled. We might want to move it up so that it's the first thing printed when cli is run. I think it's useful information to have in the console output.

I'm not sure we really need to report that were doing the check at all, only if it discovers that there's a newer version. Do we need to async check_latest_version so that the tool doesn't pause here? (the check is barely perceptable on my machine, but I have a fairly fast internet connection so it's possible that it's more noticeable to others).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works pretty fast for me too (my network speed is sometimes in kbps). I think we might not need it.

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failing on (unrelated) NVD tests, can be merged.

@terriko terriko merged commit d10d65c into intel:main Aug 4, 2021
@BreadGenie BreadGenie deleted the streamline-logger branch August 5, 2021 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Streamlining console output
5 participants