Skip to content
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

Use the requested log level when handling broken stdout pipe #6153

Merged
merged 1 commit into from
Jan 22, 2019

Conversation

cjerdonek
Copy link
Member

@cjerdonek cjerdonek commented Jan 21, 2019

This is a follow-up to PR #5907.

I noticed a tiny issue where, if a broken stdout pipe occurs and the user passed --log, then pip will print the traceback for the broken pipe even if the user didn't request verbose logging. This is because pip sets the root logger level to DEBUG if --log is passed:

# The "root" logger should match the "console" level *unless* we also need
# to log to a user log file.
include_user_log = user_log_file is not None
if include_user_log:
additional_log_file = user_log_file
root_level = "DEBUG"

This PR changes the logic inside inside the base Command.main() to use the user's requested log level instead of the root logger level when deciding whether to print the broken pipe traceback.

@cjerdonek cjerdonek added C: logging Information Logging skip news Does not need a NEWS file entry (eg: trivial changes) type: bugfix labels Jan 21, 2019
@cjerdonek cjerdonek added this to the 19.0 milestone Jan 21, 2019
@pradyunsg pradyunsg merged commit 24d2185 into pypa:master Jan 22, 2019
@cjerdonek cjerdonek deleted the use-requested-log-level branch January 22, 2019 09:11
@lock
Copy link

lock bot commented May 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: logging Information Logging skip news Does not need a NEWS file entry (eg: trivial changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants