fix a bug for -a option
add print_log function
format the code