Use with logging module
See original GitHub issueIn my module, I use the python logging module to print out messages.
During the operation which I want to monitor using alive-progress it may happen that messages are sent out using the logging module. Then, artifacts of the bar remain in the console:
Loading the fmu took 0.34800148010253906 s.
Starting simulation at t=0.0 s. | βββ
0/1000 [0%] in 0s (0.0/s, eta: ?)
Simulation took 0.7570006847381592 s.ββββ| β
ββ 990/1000 [99%] in 0s (1126.2/s, eta: 0s)
Simulation finished at t=1000.0 s.
|ββββββββββββββββββββββββββββββββββββββββ| 1000/1000 [100%] in 0.9s (1096.43/s)
The first message (βloading β¦ took β¦β) was logged before i instantiated the alive bar. The other messages were emitted while the bar was active. I am using a vanilla StreamHandler that sends everything to stdout.
By the way - dunno if thatβs possible - is it possible to have the alive bar redirected to a logging module, too? Might be interesting to have the complete (or not, in case of an error!) progress bar in a log file. Gives structureβ¦
By the way 2: itβs pretty awesome π
Cheers, Jan
Issue Analytics
- State:
- Created 4 years ago
- Comments:27 (21 by maintainers)
Top GitHub Comments
Hey, Iβm glad to report Iβve finally mastered this! π The proper logging support will be included in the next major version!
Now it is all automatically setup! The code to generate the above output is only:
Wasnβt that the bug found with Windoze?