'Return a system_message object.
Raise an exception or generate a warning if appropriate.'

def system_message(self, level, message, *children, **kwargs):

    attributes = kwargs.copy()
    if kwargs.has_key('base_node'):
        (source, line) = get_source_line(kwargs['base_node'])
        del attributes['base_node']
        if (source is not None):
            attributes.setdefault('source', source)
        if (line is not None):
            attributes.setdefault('line', line)
    attributes.setdefault('source', self.source)
    msg = nodes.system_message(message, level=level, type=self.levels[level], *children, **attributes)
    if (self.stream and ((level >= self.report_level) or (self.debug_flag and (level == self.DEBUG_LEVEL)))):
        msgtext = msg.astext().encode(self.encoding, self.error_handler)
        print >>self.stream, msgtext
    if (level >= self.halt_level):
        raise SystemMessage(msg, level)
    if ((level > self.DEBUG_LEVEL) or self.debug_flag):
        self.notify_observers(msg)
    self.max_level = max(level, self.max_level)
    return msg
