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

pip-tools logger should always go to stderr #362

Closed
cjerdonek opened this issue May 16, 2016 · 3 comments
Closed

pip-tools logger should always go to stderr #362

cjerdonek opened this issue May 16, 2016 · 3 comments
Labels
logging Related to log or console output PR wanted Feature is discussed or bug is confirmed, PR needed

Comments

@cjerdonek
Copy link

I noticed that pip-tools's logger (called LogContext here) sometimes writes to stdout (depending on the log level).

It would be best if the logger always writes to stderr since a logger is for monitoring / diagnostic purposes, and its messages can interfere if one is trying to capture the "output" portion of running the script. This would help in addressing some of the other pip-tools issues related to stdout and stderr.

In cases where stdout is needed, a separate function can be used (e.g. print()). This would help in separating pip-tools's "API" (stdout) from its diagnostic / progress reporting (stderr).

@davidovich davidovich added PR wanted Feature is discussed or bug is confirmed, PR needed and removed PR wanted Feature is discussed or bug is confirmed, PR needed labels Feb 19, 2017
cmc333333 pushed a commit to cmc333333/pip-tools that referenced this issue May 25, 2017
Rather than write to stdout via click.echo, use Python's built-in logging
mechanism. This is a bit more conventional and could allow users to configure
logs more thoroughly. It should also resolve jazzband#362.

To match the ANSI colors, this now imports the coloredlogs module.
@jdufresne
Copy link
Member

This looks like a duplicate of #353

@cjerdonek
Copy link
Author

Issue #353 is related in that fixing this issue could very well wind up fixing that one. But, for example, it's possible that not all of pip-compile --verbose's output uses the LogContext class (which is what this issue covers). We'd want to check that separately as part of issue #353, and maybe even also have a different type of test case (e.g. an end-to-end test using the CLI).

@vphilippon vphilippon added the logging Related to log or console output label Nov 24, 2017
@atugushev
Copy link
Member

atugushev commented Sep 15, 2019

I believe it's fixed in #834.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logging Related to log or console output PR wanted Feature is discussed or bug is confirmed, PR needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants