code: def error(self, message, set_error_state=False):
          
          if set_error_state:
              if message not in self._errors:
                  self._errors.append(message)
  
              self.set_error_state()
  
          self.logger.error(message)
docs: Log an error messsage.
  
          :param message:  Log message.