Progressbar doesn't print in single line
See original GitHub issueKudos for the great utility @ctongfei , I had integrated progress bar with my application and the progress keep printing in new line(Tried in terminal and eclipse ).I’m using apache log4j2 for logging. Below is my code.
`
try (InputStream inputStream = new FileInputStream(source);
ProgressBar pb = new ProgressBarBuilder()
.setInitialMax(inputStream.available())
.setTaskName("Transfering")
.setConsumer(new DelegatingProgressBarConsumer(logger
::info)).setUnit("MB", 1048576)
.build()) {
byte[] chunk = new byte[102400];
int chunkLen = 0;
while ((chunkLen = inputStream.read(chunk)) != -1) {
pb.stepBy(chunkLen);
session.getBasicRemote().sendBinary(ByteBuffer.wrap(chunk, 0, chunkLen));
}
} catch (IOException ex) {
logger.log(Level.ERROR,"Error ouccured while sending data from client ::",ex);
}`
Also i have tried all the visual styles. Any help is appreciated.

Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
python progress bar using tqdm not staying on a single line
To do that, you can print your messages using tqdm.write(msg) instead of print(msg) . If you don't want to modify run_apply() to use...
Read more >progress is not updating the progress bar on a single line #109
Hello, I'm trying too use progress with IR kernel in jupyter and I keep getting an output like: Any ideas on how to...
Read more >Write-Progress (Microsoft.PowerShell.Utility) - Microsoft Learn
This command displays the progress of a for loop that counts from 1 to 100. The Write-Progress cmdlet includes a status bar heading...
Read more >Progress Bars in Python Terminal - YouTube
Today we learn how to create and display progress bars in the command line of a Python application.
Read more >How To Add A Progress Bar In Python With Just One Line
In this Python Tutorial I show you how you can add a Progress Bar to your Python code in just one line of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Maybe we should reopen this as this seems to be a valid concern? It seems that it is because the header of the logger each line. Probably would be fixed if #71 is fixed, so that you can set a custom width?
@cloudnotify The progress bar has no knowledge of your logger header
[16 Jul 2020 22:59:57 INFO ] -, so the computed width is wrong