-
Notifications
You must be signed in to change notification settings - Fork 15
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
Using logging statements for development #11
Comments
@dgursoy, This is what we talked about today. Any more thoughts? |
Looks good. One concern is we need a level of control for the print statements though. Otherwise, it won't be structured and we can't use them easily afterwards. For example, if I print a "Hello World" somewhere, I may not want to have it in the txt file. |
I guess you could use the if __debug__:
np.save('./debug_data/', some_data) But also, if the user doesn't use the I think |
Today I learned that the logger in a python library should be set to use the |
We want to set up a system for logging information about the progress of reconstruction algorithms such as convergence criteria and which number of iterations have been completed. This system should probably use the standard logger of python and print statements for storing information optionally.
Instead of changing the API of
tike
to accommodate development, we can use the following tools to capture data in text files and display messages tostout
.Example
Here's an example that demonstrates these concepts.
dev_logging.py:
Run the script in a bash terminal:
some_data.txt:
The text was updated successfully, but these errors were encountered: