console-rs / dialoguer

Rust utility library for nice command line prompts and similar things
MIT License
1.33k stars 142 forks source link

Logging when a prompt is open #249

Open imsamuka opened 1 year ago

imsamuka commented 1 year ago

I use dialoguer along with bpaf to execute a REPL of commands in my program. The biggest issue right now is logging. When I need to warn! a user about something running in another thread, the logger also uses the stderr to print the warnings. Preferably, i wanted to make dialoguer reliably redraw itself AFTER the logging message, since the user could be in the middle of a Select or a Input, or the program was just awaiting for a new command. The other more common logs like debug! are sent to a log file, but i can't compromise error! and warn!.

Is there any known reliable workarounds for this and intended support?