Fix logs with tty
add CmdLogs test