vbauerster / mpb

multi progress bar for Go cli applications
The Unlicense
2.29k stars 123 forks source link

Any option to print logs below progress bar, without progress bar getting duplicated? #118

Closed roshinimichael closed 1 year ago

roshinimichael commented 1 year ago

Currently my single progress bar gets duplicated, if any log output is printed in any of the calling functions.

Bar 1 ∙∙∙ [############################################..................] 71 %
Log output 1
Bar 1    [##############################################################] 100 %
Log output 2

Is there a way to print any associated logs like this, for a single progress bar?

Bar 1    [##############################################################] 100 %
Log output 1
Log output 2
mskonovalov commented 1 year ago

~Yes, there is a way to do it~. Follow this example _examples/progressAsWriter/main.go

Also https://github.com/vbauerster/mpb/issues/105 for the context

mskonovalov commented 1 year ago

oh, sorry, you cannot print log below only above, because the way how progress bar is working in terminal it can work only on the last line.

roshinimichael commented 1 year ago

thank you for your response!