-
Notifications
You must be signed in to change notification settings - Fork 32
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
Change print statements to logging.info
#116
Comments
Seems like a good move to me. |
Hmm the default logging level is "warning", not info, so just replacing print with logging.info will make all the printed stuff disappear. This makes this not a very good solution. |
To make this work, we'd also need to have this line:
at the top of any module that uses logging. Not very elegant. |
Apologies if my earlier "seems like a good move" implied that I knew enough about logging to think it could work... I am new to logging but have been meaning to read up on it more. Now that I have played with it a bit:
Then in each verbose-enabled function you would log info messages with
) |
I like this suggestion, thanks a lot Matthew! I'll update my PR with that and play with it a bit. |
e.g. the print statements in pixell.lensing.
This will allow the user to redirect all output in their program to their desired log file (or by default print to the console as usual).
The text was updated successfully, but these errors were encountered: