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

Improve updater and tests logging #1092

Merged
merged 2 commits into from
Jul 30, 2020

Conversation

sechkova
Copy link
Contributor

Fixes issue #: #1083

Description of the changes being introduced by the pull request:

  • Add NullHandler() to the top-level logger
  • Replace logging.exception calls in Updater()

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

Adding a do-nothing handler to the top-level 'tuf' logger
in case no other handlers exist (in tests for example).

Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
Using logging.exception logs messages to the root logger and
calls  basicConfig() to add a console handler with a pre-defined
format which breaks the current logging configuration.

Replacing logging.exception with logger.exception which is the
logger for the updater module.

Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
@sechkova
Copy link
Contributor Author

The proposed changes here are related to getting rid of the logging when it is not needed.
On the other hand, probably there's also a similar need of a common way to enable/increase the logging when needed (for debugging etc)

Copy link
Member

@trishankatdatadog trishankatdatadog left a comment

Choose a reason for hiding this comment

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

💯

Too much noise out-of-the-box right now

We can figure out configurable options later

Copy link
Member

@joshuagl joshuagl left a comment

Choose a reason for hiding this comment

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

Thank you for finding and fixing this issue @sechkova! I'm not sure I completely agree with the current logging behaviour, but let's figure that out later.

tuf/client/updater.py Show resolved Hide resolved
@joshuagl joshuagl merged commit 0c07311 into theupdateframework:develop Jul 30, 2020
@sechkova sechkova deleted the updater_logging branch July 30, 2020 14:32
@joshuagl joshuagl mentioned this pull request Aug 4, 2020
3 tasks
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.

3 participants