Encode self.name for logging.