refine and fix logging.debug