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

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 referenced a pull request that will close this issue Jun 23, 2016
@fasiabbu

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

@amueller amueller commented Oct 13, 2016

somewhat related #78

@mitar

This comment has been minimized.

Copy link
Contributor

@mitar mitar commented Jul 4, 2018

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

@jnothman

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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
5 participants
You can’t perform that action at this time.