add log/clean_log functions