Skip to content

Standardise link repr in logs #11083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Standardise link repr in logs #11083

wants to merge 1 commit into from

Conversation

q0w
Copy link
Contributor

@q0w q0w commented May 3, 2022

Closes #7390
ref: #10276 (comment)

@@ -170,7 +165,7 @@ def __call__(
logger.critical(
"HTTP error %s while getting %s",
e.response.status_code,
link,
link.show_url,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be show_url but the entire URL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So its still inconsistent link repr in logs - as described in the issue

url = str(link)
if logger.getEffectiveLevel() > logging.DEBUG:
url = link.show_url
meth("Could not fetch URL %s: %s - skipping", url, reason)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think warnings/errors should present partial URLs, since its possible that the user has multiple indexes and needs to know which one the error is related to, without adding additional verbosity.

else:
url = link.url_without_fragment

url = link.show_url
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only part of the change that I'm somewhat fine with, but I wonder if show_url should also mention the domain. That's something we can address in a follow up though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make link logging more consistent
2 participants