Realtime & fix output log, optimize cpu usage

Realtime & fix output log, optimine cpu usage