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.

Default handlers log too much and there's no way to disable them through the library API

See original GitHub issue

I’m trying to use backoff with a login function that connects to an external server. The code looks something like this.

@backoff.on_exception(backoff.expo, FailedConnection)
def login(username, password):
    # stuff

When on_backoff triggers, the default handler is invoked which logs the signature which includes the password in this case.

It’d be great to have a way to disable/override the default handlers to provide my own logging behavior.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
bgreen-litlcommented, Oct 18, 2016

@duckpunch sorry merging this got delayed because I was trying to work out the best way to accommodate the competing goal of making the original behavior available in a convenient way via the API. That said, I’m actually inclined to merge this and release it as is as backoff==1.3.2 since I consider this potential for unwanted information leakage to be a security issue.

@luckydonald I have a WIP for supporting the original logging behavior out of the box via the API, but it involves some subtle changes in the contract of the event handler callbacks. As such, I’d probably end up releasing it as 1.4 but I’m not quite ready for that. In the meantime, you can either use the user-space implementation I suggested above, or freeze backoff at 1.3.1.

0reactions
bgreen-litlcommented, Nov 18, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

java.util.logging - How can I disable the default console ...
I want to use two handlers. A file handler and my own console handler. Both of my handlers work fine. My logging is...
Read more >
logging.handlers — Logging handlers — Python 3.11.1 ...
The default implementation calls the 'namer' attribute of the handler, if it's callable, passing the default name to it. If the attribute isn't...
Read more >
Python Logging Guide - Best Practices and Hands-on Examples
Log data is often a log message, which is a string, along with some extra data to be logged. Often, the logging API...
Read more >
Troubleshoot form issues in model-driven apps - Microsoft Learn
Not all control state change attempts are successful. For a control disabled by form XML, you can enable it through client API in...
Read more >
Python Logging Basics - The Ultimate Guide To Logging
The default, which is there for backward compatibility only, will disable any loggers created by modules. This can break many modules, so use...
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