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

Library should not be printing to stdout without verbose option #6929

Open
jnothman opened this issue Jun 23, 2016 · 7 comments · May be fixed by #6930
Open

Library should not be printing to stdout without verbose option #6929

jnothman opened this issue Jun 23, 2016 · 7 comments · May be fixed by #6930

Comments

@jnothman
Copy link
Member

@jnothman jnothman commented Jun 23, 2016

I think it's good policy not to print anything to standard output in library code, except when that's specified by the API, e.g. through a verbose parameter. We have, for instance, a few unguarded print calls in sklearn/datasets. These should be weeded out. One option for fixing is to use logging.info; another is to use print(..., file=sys.stderr).

SahilKang added a commit to SahilKang/scikit-learn that referenced this issue Jun 23, 2016
@SahilKang SahilKang linked a pull request that will close this issue Jun 23, 2016
@fasiabbu
Copy link

@fasiabbu fasiabbu commented Jun 24, 2016

Hi,
I see there are still a lot of places where print is being used. I presume all this should converted to logging.info. Is anybody working on this?

@lesteve
Copy link
Member

@lesteve lesteve commented Jun 24, 2016

@fasiabbu somebody is already working on this, look at the PR above i.e. #6930.

@amueller
Copy link
Member

@amueller amueller commented Oct 13, 2016

somewhat related #78

@mitar
Copy link
Contributor

@mitar mitar commented Jul 4, 2018

I would also prefer if all output would go through Python logging.

@jnothman
Copy link
Member Author

@jnothman jnothman commented Jul 4, 2018

Yes, this could do with some love. One concern is that we're not sure how to manage backwards compatibility.

@mitar
Copy link
Contributor

@mitar mitar commented Jul 4, 2018

Backwards compatibility being going to warn and print, or even the formatting of what has been printed out?

@jnothman
Copy link
Member Author

@jnothman jnothman commented Jul 4, 2018

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

Successfully merging a pull request may close this issue.

5 participants