code: def log_error(self, msg, *args):
          
          if self._logger is not None:
              self._logger.error(msg, *args)
          else:
              print(msg % args)
docs: Log an error or print in stdout if no logger.