cleanup of output preventing interleaving of logs and stacktraces