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.

Allow tweaking the presentation style of logged errors

See original GitHub issue

Context

What are you trying to do?

I’ve been trying to improve pip’s output (hopefully, you’ve noticed!) and our networking-related output seems like a really good candidate to try to improve. This includes various kinds of errors originating from urllib3 and especially the presentation when there’s going to be a retry.

WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x10439a3a0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/foooooooooooooo/

How do you expect to do it?

Would it be OK to change that into multiple log messages, at debug and warning levels? That way, the logging presentation would look like:

WARNING: Connection broken to /simple/foooooooooooooo/
WARNING: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
DEBUG: NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x10439a3a0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')
WARNING: Will retry connection (3 remaining retries)
DEBUG: Retry(total=3, connect=None, read=None, redirect=None, status=None)

While a “regular” output would be:

WARNING: Connection broken to /simple/foooooooooooooo/
WARNING: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
WARNING: Will retry connection (3 remaining retries)

I mean, honestly, an ideal solution would probably look like some way to hook into pip’s new error message presentation:

warning: will-retry-network-failure

× Retrying connection to https://pypi.org/simple/foooooooooooooo/
╰─> Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

    Remaining retries: 3

note: This is an issue with the network connection.

Is it something you currently cannot do? Nope.

Is this related to an existing issue/problem? Nope.

Alternatives

Can you achieve the same result doing it in an alternative way? I looked, and the only thing I could think of is a hacky formatter for urllib3. 🤷🏽

Is the alternative considerable? 🤷🏽

Duplicate

Has the feature been requested before? Not that I could find.

Contribution

Would you be willing to submit a PR? Depends on what level of complexity is involved in implementing this, and how aggressively we scope-creep on this. 😃 (Help can be provided if you need assistance submitting a PR)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
pradyunsgcommented, Nov 24, 2022

This feels like you have some problem with me.

Ooops, I didn’t realise that sentence would come across in that way – I was merely pointing out that you’re the only contributor/maintainer who’s engaged in this issue so far, and that you didn’t like the suggestions made in OP, and that no other maintainer has engaged so far.

In case it isn’t clear from the above: I don’t have a problem with you. 😃

0reactions
hynekcommented, Nov 30, 2022

Not a fan of making free promises, but that values coincide with mine. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tips for Tweaking Your PowerPoint Presentation
After all of the errors in your project have been fixed (spelling wise), you will be notified that everything is correct. The next...
Read more >
How to Give a Killer Presentation - Harvard Business Review
Instead, go deeper. Give more detail. Don't tell us about your entire field of study—tell us about your unique contribution.
Read more >
How to fix the Office 365 Mac editing error - Setapp
Learn what to do when you get the “View only your account doesn't allow editing on a Mac” error in Microsoft Office products....
Read more >
Check spelling in your presentation - Microsoft Support
As you work on a presentation, PowerPoint automatically checks spelling and basic grammar to help you avoid errors and mistakes.
Read more >
Issues · urllib3/urllib3 - GitHub
util.parse_url allows invalid characters in reg-names. #2802 opened on Nov 12 by kenballus ... Allow tweaking the presentation style of logged errors.
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