rewrite main() function of ucsm_log.py

Signed-off-by: Dong Zhu <bluezhudong@gmail.com>