add function for clean_log.