add rm_end_space.py and fix setup_logging bug.