def log_warning(self, msg):
        """
        Log a warning if ``logger`` exists.

        Args:
            msg: Warning to log.

        Warning:
            Can raise a ``RuntimeError`` if this was asked in the constructor.

        """
        if self.__logger:
            self.__logger.warning(msg)

        if self.__raise_exception_on_warning:
            raise RuntimeError(msg)
Log a warning if ``logger`` exists.

        Args:
            msg: Warning to log.

        Warning:
            Can raise a ``RuntimeError`` if this was asked in the constructor.