Console input is interupted by output
I have a Kotlin console application with a lot of log messages.
For testing, I want to enter certain admin commands in the console. However, each log message apparently erases my console input buffer.
How can I reliably read a line or even just individual chars from the console, while other threads are printing log messages to that console?
fun main() {
thread(isDaemon=false, name = "ConsoleThread") {
while(true) {
println("(doit) do something")...