Skip to content

Unify Logging #276

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

Merged
merged 2 commits into from
Jan 13, 2020
Merged

Unify Logging #276

merged 2 commits into from
Jan 13, 2020

Conversation

PrajwalM2212
Copy link
Contributor

@PrajwalM2212 PrajwalM2212 commented Jan 9, 2020

  1. This PR removes all print statements and replaces it with log statements.
  2. All logs below error level are logged to stdout and all logs above and equal to error level are logged to stderr

Closes #197
Closes #182

@PrajwalM2212
Copy link
Contributor Author

@terriko @pdxjohnny Can you review this so that I can continue with removing the verbose/quiet flags.

@PrajwalM2212 PrajwalM2212 changed the title WIP: Unify Logging Unify Logging Jan 10, 2020
@PrajwalM2212
Copy link
Contributor Author

PrajwalM2212 commented Jan 10, 2020

  1. Verbose and quiet flags have been removed. This functionality can now be obtained from --log option.
    Not specifying --log is equivalent to quiet flag. specifying --log is equivalent to verbose flag.

  2. Error logs go to stderr. Other logs go to stdout

Non errror logs go to stdout
Screen Shot 2020-01-10 at 2 27 53 PM
log.txt
Screen Shot 2020-01-10 at 2 27 44 PM

Error Logs go to stderr
Screen Shot 2020-01-10 at 2 30 41 PM
log.txt
Screen Shot 2020-01-10 at 2 30 33 PM

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 lovely work. Thank you so much! Just two changes then I think we're good to merge!

Copy link

@johnandersen777 johnandersen777 left a comment

Choose a reason for hiding this comment

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

One last thing then this is good to go, thanks!

print("Known CVEs in version " + str(version))
print(", ".join(found_cves.keys()))
self.logger.info(
filename, result["is_or_contains"], modulename, version

Choose a reason for hiding this comment

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

The first argument to this should be a format string, "%s %s %s %s"

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.

Improve NVD output so error messages go to stderr instead of stdout Unify logging vs verbose/quiet flags?
3 participants