8000 feat: Add debug log support in client init by mitsuhiko · Pull Request #115 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content

feat: Add debug log support in client init #115

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
Oct 20, 2018
Merged

Conversation

mitsuhiko
Copy link
Contributor

No description provided.

@codecov-io
Copy link
codecov-io commented Oct 9, 2018

Codecov Report

Merging #115 into master will decrease coverage by 0.2%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #115      +/-   ##
=========================================
- Coverage   66.91%   66.7%   -0.21%     
=========================================
  Files          25      25              
  Lines        2457    2526      +69     
  Branches      352     362      +10     
=========================================
+ Hits         1644    1685      +41     
- Misses        680     707      +27     
- Partials      133     134       +1
Impacted Files Coverage Δ
sentry_sdk/debug.py 96.42% <100%> (+4.42%) ⬆️
sentry_sdk/integrations/__init__.py 53.94% <100%> (-2.12%) ⬇️
sentry_sdk/client.py 58.68% <83.33%> (+1.18%) ⬆️
sentry_sdk/integrations/stdlib.py 74.46% <0%> (-8.52%) ⬇️
sentry_sdk/integrations/django/__init__.py 67.77% <0%> (-3.34%) ⬇️
sentry_sdk/_compat.py 78.84% <0%> (-1.93%) ⬇️
sentry_sdk/transport.py 59.55% <0%> (-1.38%) ⬇️
sentry_sdk/utils.py 66.19% <0%> (-0.61%) ⬇️
... 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 68b8533...ebde09b. Read the comment docs.

@mitsuhiko mitsuhiko requested a review from untitaker October 9, 2018 11:33
@untitaker
Copy link
Member

What do you think about initializing integrations only when the client is bound to a hub or gets its first event?

@mitsuhiko
Copy link
Contributor Author

@untitaker initialize = call init_once? Probably not so much because that puts potential concurrency issues on the first request of a web app.

@untitaker
Copy link
Member

Ok, then why not when the client is bound to a hub? Integrations are ineffective anyway if the client isn't bound to a hub.

@mitsuhiko
Copy link
Contributor Author

What's the benefit of doing that? I just worry this is going to make things worse for no obvious benefit.

@untitaker
Copy link
Member

I'm just suggesting it as alternative to this one. I don't see drawbacks for either.

@mitsuhiko
Copy link
Contributor Author

So your proposal would be to remove the setup_integartions call in init and the context var, and have setup_integrations be called lazily on hub bind?

@untitaker
Copy link
Member

Yes, but I don't know if it's a good idea.

@untitaker
Copy link
Member

@mitsuhiko any opinion on my proposal? I don't really care anymore

@mitsuhiko
Copy link
Contributor Author

@untitaker i am considering it. i think debug logging is a bit stupid right now for more than one reason so it would be good to change it. eg: debug messages from the transport are suppressed.

@untitaker
Copy link
Member

I don't think we can make a single API change that fixes both cases in case that's what you're aiming for.

@mitsuhiko
Copy link
Contributor Author

@untitaker no, but when making the logger explicit (eg: per hub) this PR becomes pointless.

@untitaker
Copy link
Member
untitaker commented Oct 11, 2018 via email

@untitaker
Copy link
Member

@mitsuhiko I'm actually fine with this as-is. Do you have any concerns?

@mitsuhiko
Copy link
Contributor Author

WFM. We can still clean it up later. It's just that it does not solve the issue that transports don't log.

@untitaker untitaker merged commit 35cfa0d into master Oct 20, 2018
@untitaker untitaker deleted the feature/debug-logs branch October 20, 2018 20:54
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
0