rsalmei / alive-progress

A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
MIT License
5.53k stars 206 forks source link

does not work nicely with logging StreamHandler #91

Closed spaanse closed 3 years ago

spaanse commented 3 years ago

We have an application that uses the python logging module with a StreamHandler:

import logging as log

sh = log.StreamHandler()
# we set the format used in the streamhandler
log.basicConfig(level=log.INFO, handlers=[sh])

This works nicely until we enter the alive-bar environment. Before it outputs the log to stderr, with a single newline between each line. In the environment it outputs the log to stdout, and there is an empty line between each log line. The empty lines even occur when I redirect stdout to a file. That file get's the form

log line

<0x1b>[2K
log line
...
rsalmei commented 3 years ago

Hey @spaanse, humm, I think it is already fixed on the soon-to-be-released 2.0 version... Could you please try it with pip install git+https://github.com/rsalmei/alive-progress.git@rsa-refac? Let me know if that really fixes it.

rsalmei commented 3 years ago

Well, please reopen when you can see into this again.