Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-68443: Replace debug level-related logic in http client with logging#8633

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
CuriousLearner wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromCuriousLearner:fix-issue24255

Conversation

@CuriousLearner
Copy link
Member

@CuriousLearnerCuriousLearner commentedAug 2, 2018
edited by bedevere-appbot
Loading

@CuriousLearner
Copy link
MemberAuthor

CuriousLearner commentedAug 7, 2018
edited
Loading

@vsajip Hello, I see that there are various linting errors intest_logging.py which were fixed in5f63c20. Does it make sense to separate them out in another Pull Request?

@willingcwillingc self-requested a reviewOctober 7, 2018 09:23
@CuriousLearner
Copy link
MemberAuthor

Hey@bitdancer ,@vsajip

Can you please have a look at this? I just noticed this PR wasn't reviewed from almost a year. Please let me know, what is needed here.

Thanks!

@willingc
Copy link
Contributor

@CuriousLearner I would go ahead and rebase to resolve conflicts.

@CuriousLearner
Copy link
MemberAuthor

@willingc Done!

raise LineTooLong("status line")
if self.debuglevel > 0:
print("reply:",repr(line))
_log.info("reply: {}".format(repr(line)))

Choose a reason for hiding this comment

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

logging first argument support old format string, so_log.info("reply: %s", repr(line)) would work. There is mixed calls of{}".format(foo with%s", foo, wouldn't be better to stick with one?

Copy link
Member

Choose a reason for hiding this comment

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

wouldn't be better to stick with one?

I agree -% should work fine and a lot of logging uses %-formatting rather than.format() due to its age.

Copy link
Contributor

Choose a reason for hiding this comment

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

There is another reason: tools like Sentry use message pattern as a key for logs grouping.
Adding pre-formatted messages to Sentry is very ineffective.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ah, sorry!

I think I came back to this later and followed the same style as for other Python projects I was involved with.

Fixing this!

import io
import itertools
import os
import sys

Choose a reason for hiding this comment

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

This isn't being used anywhere!?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yeah, good catch. I think it remained here while I was working on this.

logger = logging.getLogger("http")
root_logger = self.root_logger
root_logger.removeHandler(self.root_logger.handlers[0])
logger = logging.getLogger("httplogger")
Copy link
Member

Choose a reason for hiding this comment

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

Why this name change?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

There is no specific reason for it. I'll just revert back.

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelDec 15, 2024
@picnixzpicnixz changed the titlebpo-24255: Replace debug level-related logic in http client with logginggh-68443: Replace debug level-related logic in http client with loggingDec 15, 2024
@github-actionsgithub-actionsbot removed the staleStale PR or inactive for long period of time. labelFeb 27, 2025
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelApr 13, 2025
@python-cla-bot
Copy link

python-cla-botbot commentedApr 18, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@github-actionsgithub-actionsbot removed the staleStale PR or inactive for long period of time. labelApr 18, 2025
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelJun 15, 2025
@github-actionsgithub-actionsbot removed the staleStale PR or inactive for long period of time. labelOct 12, 2025
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelNov 11, 2025
@CuriousLearnerCuriousLearner removed the staleStale PR or inactive for long period of time. labelNov 14, 2025
Replace debuglevel-based print statements with Python's standardlogging module for better integration with logging frameworks andlog aggregation tools like Sentry. Uses % formatting consistentlyfor better log pattern matching in aggregation tools.
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelJan 6, 2026
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@willingcwillingcAwaiting requested review from willingc

@bitdancerbitdancerAwaiting requested review from bitdancer

@vsajipvsajipAwaiting requested review from vsajipvsajip is a code owner

@asvetlovasvetlovAwaiting requested review from asvetlov

@dhilstdhilstAwaiting requested review from dhilst

Assignees

No one assigned

Labels

awaiting reviewstaleStale PR or inactive for long period of time.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

8 participants

@CuriousLearner@willingc@vsajip@asvetlov@dhilst@the-knights-who-say-ni@ezio-melotti@bedevere-bot

[8]ページ先頭

©2009-2026 Movatter.jp