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

Open
cjerdonek opened this Issue May 16, 2016 · 2 comments

Comments

Projects
None yet
4 participants
@cjerdonek

cjerdonek commented May 16, 2016

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 and removed PR wanted labels Feb 19, 2017

cmc333333 pushed a commit to cmc333333/pip-tools that referenced this issue May 25, 2017

CM Lubinski
Replace custom logging with built-in version.
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 #362.

To match the ANSI colors, this now imports the coloredlogs module.

@cmc333333 cmc333333 referenced a pull request that will close this issue May 25, 2017

Open

Replace custom logging with built-in version. #513

1 of 3 tasks complete
@jdufresne

This comment has been minimized.

Show comment
Hide comment
@jdufresne

jdufresne May 31, 2017

Member

This looks like a duplicate of #353

Member

jdufresne commented May 31, 2017

This looks like a duplicate of #353

@cjerdonek

This comment has been minimized.

Show comment
Hide comment
@cjerdonek

cjerdonek May 31, 2017

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).

cjerdonek commented May 31, 2017

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment