Fix logs with tty

Fixes #2414 

It would be nice to reformat the whole logging system at some point, but for now, this fix will do.