refine logging.