Refine debug logging.