    def _log_name(self):
        """Return username:servername or username

        Used in logging for consistency with named servers.
        """
        if self.user:
            user_name = self.user.name
        else:
            # no user, only happens in mock tests
            user_name = "(no user)"
        if self.name:
            return f"{user_name}:{self.name}"
        else:
            return user_name
Return username:servername or username

Used in logging for consistency with named servers.
jupyterhub/spawner.py