def log_warning(self, msg):
if self.__logger:<EOL><INDENT>self.__logger.warning(msg)<EOL><DEDENT>if self.__raise_exception_on_warning:<EOL><INDENT>raise RuntimeError(msg)<EOL><DEDENT>
Log a warning if ``logger`` exists.

Args:
    msg: Warning to log.

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