Skip to content

Improve updater and tests logging - #1092

Merged
joshuagl merged 2 commits into
theupdateframework:developfrom
sechkova:updater_logging
Jul 30, 2020
Merged

joshuagl merged 2 commits into
theupdateframework:developfrom
sechkova:updater_logging

Conversation

@sechkova

Copy link
Copy Markdown
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

sechkova added 2 commits July 29, 2020 18:01
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 <[email protected]>
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 <[email protected]>
@sechkova

Copy link
Copy Markdown
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)

@trishankatdatadog trishankatdatadog left a comment

Copy link
Copy Markdown
Contributor

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

@joshuagl joshuagl left a comment

Copy link
Copy Markdown
Member

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.

Comment thread tuf/client/updater.py 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