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

How to write final receipt into a log file #284

Open
Vinye opened this issue Nov 8, 2024 · 0 comments
Open

How to write final receipt into a log file #284

Vinye opened this issue Nov 8, 2024 · 0 comments

Comments

@Vinye
Copy link

Vinye commented Nov 8, 2024

Hello!

Thank you for creating this awesome library 👏

One of my reasons for using this library is precisely how well it behaves with the Python logging module. However, now I find myself in a situation where I'd actually like to include the final receipt in a log file.

Basically, I'm using Python logging module in my code and I initialize it with both a StreamHandler and a FileHandler. alive_bar is initialized in unknown mode. Then I loop over a dataset while alive_bar keeps track of the progress and shows it in stdout. Now, at the end of the loop, I'd like to print the final receipt into the log file and not just stdout. Since I use alive_bar in unknown mode, the final receipt contains useful information like the number of samples processed and the throughput. I would like to save these numbers in logs for later reference. This would also save me from the need to have a separate variable for counting the total number of items that have been processed.

As far as I can tell, this is currently not possible with alive-progress. Would it be possible to have this feature?

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

1 participant