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

Log info messages #141

Open
cbrnr opened this issue Feb 8, 2024 · 2 comments · May be fixed by #159
Open

Log info messages #141

cbrnr opened this issue Feb 8, 2024 · 2 comments · May be fixed by #159
Assignees

Comments

@cbrnr
Copy link
Contributor

cbrnr commented Feb 8, 2024

Currently, all info messages are printed to stdout via tqdm.write(). This is very useful for the CLI. However, I think it would be nice to log these messages to info (instead of printing) when using the Python interface.

One way to implement this is to do logger.info() by default and add a new parameter to download() (e.g. redirect_logging=False), which the CLI would set to True.

Since there are a couple of other functions that produce messages, we'd need to add the parameter there as well (a bit cumbersome). It would be nice to have some global option, but I couldn't think of a nice way to implement that so far (ideas welcome).

Finally, I think when logging messages, these should not get too long, so maybe these could be modified to at least not contain line breaks.

@hoechenberger
Copy link
Owner

hoechenberger commented Apr 12, 2024

can we figure out whether we're currently running from the command line or via Python? perhaps by finding the parent process?

otherwise we could set a global variable during CLI initialization and then make use of this

@cbrnr
Copy link
Contributor Author

cbrnr commented Apr 12, 2024

👍 for a global variable, this seems like a straightforward approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants