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

[JOSS review] Logging and verbosity #41

Closed
cheginit opened this issue May 31, 2021 · 3 comments
Closed

[JOSS review] Logging and verbosity #41

cheginit opened this issue May 31, 2021 · 3 comments
Assignees

Comments

@cheginit
Copy link

cheginit commented May 31, 2021

Since many Python users use Jupyter as their IDE, the logging info should be redirected to stdout so the logs don't show up with red background. You can do so by configuring the logger, for example, as follows:

import logging
import sys

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(logging.Formatter(""))
logger.handlers = [handler]
logger.propagate = False

Also, the model is unnecessarily verbose by default. It might not matter much when you run the code via command-line but when you run it via Jupyter it causes issues. A much better approach is to use tqdm. I think a quick fix can be reducing the verbosity by default.

EDIT: Reference to openjournals/joss-reviews#3221

@cheginit
Copy link
Author

Here's an example screenshot from Jupyter:
image

@cheginit cheginit changed the title Logging and verbosity [JOSS review] Logging and verbosity May 31, 2021
@thurber thurber self-assigned this Jun 1, 2021
@thurber
Copy link
Contributor

thurber commented Jun 1, 2021

This is a good point, I can adjust the majority of the logging to be debug level, and only echo the configuration into the file logger.

Curious, from your perspective, is logging the current timestep useful? Perhaps just at daily or monthly or yearly intervals?

@cheginit
Copy link
Author

cheginit commented Jun 1, 2021

I think if you go with tqdm daily is fine. Otherwise, I think monthly or yearly works better as you said. I wonder if you tested the impact of logging on the performance? Since IO can sometimes affect the performance significantly, depending on the time each time-step takes.

@thurber thurber mentioned this issue Jun 3, 2021
@thurber thurber closed this as completed in 721b5d5 Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants