question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to re-enable loggers in logging integration

See original GitHub issue

We 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:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
untitakercommented, Dec 14, 2019

Those warnings are insignificant and gone in the latest version of the SDK. It’s a deprecation warning where this code:

init(integrations=[FooIntegration()])
init(integrations=[BarIntegration()])

used to cause Foo and Bar to be enabled in old versions while new SDK versions only enable Bar.

0reactions
EvertEtcommented, Dec 14, 2019

Using with sentry_sdk.Hub(None): works perfectly for what I needed, thank you!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found