Mpdreamz / shellprogressbar

ShellProgressBar - display progress in your console application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Displaying outside console messages

petervanleeuwen opened this issue · comments

Is there a way to send messages to the progress bar for it to display permanently? I am thinking of something like how gradle works.

Currently, the issue I am dealing with is that NLog is sending messages to the console and the cursor reset makes everything look janky. I have disabled console logging but would love a solution that could both display a progress bar and display permanent messages.

@petervanleeuwen I struggled with the same problem. I currently worked around that by spawning child progress bar and displaying the messages on that, but I do not call tick on it so it doesn't show progress. It kinda solved this issue for me.

One problem with this is that it still displays the percentage and since there is no progress it will always display %0.0 before the permanent message. Workaround is that add "\r" at the beginning of the string which will get rid of the percentage text for you.

The other problem is that you will see an extra time counter at the end of your message since it is still a progress bar which is not a big deal for my case.

Hope this helps.

Completely missed this issue but a feature covering this went into 4.3.0

https://github.com/Mpdreamz/shellprogressbar/releases/tag/4.3.0

That allows you to call WriteLine() on the console to persist important messages outside of the progressbar.

writeline

Hope this helps!