Ability to re-enable loggers in logging integration
See original GitHub issueWe can disable loggers using ignore_logger
but we cannot re-enable them.
The use case I have is the following code
try:
blob_service.get_blob_to_path(storage_container, blob, local_path)
except AzureMissingResourceHttpError:
logging.debug(...)
Running this code and running into a AzureMissingResourceHttpError
error shows up in sentry because get_blob_to_path
logs an error into its own logger (azure.storage.common.storageclient
).
Since I found no clean way to filter this in before_send (I thought about setting a flag that we’re handling the error ourselves), I would like to disable and re-enable the logger around this call.
Would this be possible (open to a PR?) or is there a better solution?
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
logging — Logging facility for Python — Python 3.11.1 ...
Indicates if a message of severity level would be processed by this logger. This method checks first the module-level level set by logging.disable(level)...
Read more >Python Logging Basics - The Ultimate Guide To Logging
This article covers the basics of using the standard logging module that ships with all Python distributions. After reading this, you should be...
Read more >Python Logging Guide - Best Practices and Hands-on Examples
A logger processes a log request if the numeric value of the requested logging level is greater than or equal to the numeric...
Read more >Integration Services (SSIS) Logging - Microsoft Learn
This procedure describes how to add logs to a package, configure package-level logging, and save the logging configuration to an XML file. You ......
Read more >How to Collect, Customize, and Centralize Python Logs
Customize the priority level and destination of your logs; Configure a custom setup that involves multiple loggers and destinations; Incorporate ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Those warnings are insignificant and gone in the latest version of the SDK. It’s a deprecation warning where this code:
used to cause Foo and Bar to be enabled in old versions while new SDK versions only enable Bar.
Using
with sentry_sdk.Hub(None):
works perfectly for what I needed, thank you!