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

fix(log): Expensive DEBUG log always run (#470) #471

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

rpatterson
Copy link
Contributor

Don't run expensive JSON serialization for DEBUG logging unless that level would be printed/emitted.

Fixes #470

Don't run expensive JSON serialization for `DEBUG` logging unless that level would be
printed/emitted.

Fixes trim21#470
@rpatterson
Copy link
Contributor Author

I don't see how this change could have caused the docs failure?

@trim21
Copy link
Owner

trim21 commented Aug 20, 2024

I don't see how this change could have caused the docs failure?

not your fault

@@ -275,7 +275,9 @@
"failed to parse response as json", method=method, argument=arguments, rawResponse=http_data
) from error

self.logger.debug(json.dumps(data, indent=2))
if self.logger.isEnabledFor(logging.DEBUG):
self.logger.debug(json.dumps(data, indent=2))

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (password)
as clear text.
This expression logs
sensitive data (password)
as clear text.
This expression logs
sensitive data (password)
as clear text.
This expression logs
sensitive data (password)
as clear text.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pre-existing issue, right?

Copy link
Owner

Choose a reason for hiding this comment

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

yes

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 77.62%. Comparing base (a6b7722) to head (b4eb97b).
Report is 36 commits behind head on master.

Files with missing lines Patch % Lines
transmission_rpc/client.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #471      +/-   ##
==========================================
- Coverage   77.67%   77.62%   -0.06%     
==========================================
  Files          14       14              
  Lines        1505     1506       +1     
==========================================
  Hits         1169     1169              
- Misses        336      337       +1     
Flag Coverage Δ
3.10 77.62% <50.00%> (-0.06%) ⬇️
3.11 77.62% <50.00%> (-0.06%) ⬇️
3.12 77.62% <50.00%> (-0.06%) ⬇️
3.8 77.42% <50.00%> (-0.06%) ⬇️
3.9 77.42% <50.00%> (-0.06%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@trim21 trim21 merged commit 7d8445d into trim21:master Aug 20, 2024
19 of 21 checks passed
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.

Expensive JSON serialization always run for debug logging
2 participants