Adds debug logging.