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.

load_account UserWarning should have stacklevel=2

See original GitHub issue

When load_account is ran twice, a warning is triggered: Screen Shot 2019-10-04 at 4 52 33 PM

The last line in the message, is a bit confusing because looks like an incomplete duplication. I suggest to use warnings.warn('Credentials are already in use. The existing account in the session will be replaced.', stacklevel=2), so the error would look like this: Screen Shot 2019-10-04 at 4 58 23 PM

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ajavadiacommented, Oct 9, 2019

Yes that would be great thanks!

On Oct 9, 2019, at 5:16 AM, Diego M. Rodríguez notifications@github.com wrote:

@ajavadia the use of warning has been essentially carried over from the times where load_account was introduced - at that point in time, it was deemed preferable to use a warning instead of logger.warning on the grounds that it would be “more visible to users”; and it sort of stuck as the usual philosophy for the provider for similar messages and context.

Personally I also feel more comfortable with a plain logger.warning and placing a bit more trust on the users being slightly more familiar with the logging facilities - does your comment count as having your green light for adopting that approach? 🤞

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

0reactions
diego-plan9commented, Oct 9, 2019

@ajavadia the use of warning has been essentially carried over from the times where load_account was introduced - at that point in time, it was deemed preferable to use a warning instead of logger.warning on the grounds that it would be “more visible to users”; and it sort of stuck as the usual philosophy for the provider for similar messages and context.

Personally I also feel more comfortable with a plain logger.warning and placing a bit more trust on the users being slightly more familiar with the logging facilities - does your comment count as having your green light for adopting that approach? 🤞

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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