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

Closed
jnothman opened this issue Jun 23, 2016 · 9 comments
Closed

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

jnothman opened this issue Jun 23, 2016 · 9 comments

Comments

@jnothman
Copy link
Member

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

@fasiabbu
Copy link

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 commented Jun 24, 2016

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

@amueller
Copy link
Member

somewhat related #78

@mitar
Copy link
Contributor

mitar commented Jul 4, 2018

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

@jnothman
Copy link
Member Author

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 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 commented Jul 4, 2018 via email

@dkgaraujo
Copy link

It seems this is still open. One possibility to deal with users expecting prints to stdout is to append all existing prints with a deprecation warning, mentioning that in a next 1.x version the prints would be taken out and the user might adjust the verbose parameter (or whatever the other solution is).

@adrinjalali
Copy link
Member

Closing as duplicate of #78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

8 participants