예제 #1
0
def format_events(raw_events, time=None,
                  index=None, host=None, source=None, sourcetype=None,
                  stanza=None, unbroken=False, done=False):
    return XMLEvent.format_events(XMLEvent(data, time=time,
                                           index=index, host=host,
                                           source=source,
                                           sourcetype=sourcetype,
                                           stanza=stanza, unbroken=unbroken,
                                           done=done) for data in
                                  raw_events)
예제 #2
0
    def write_events(self, events):
        if not events:
            return

        data = ''.join(XMLEvent.format_events(events))
        with self._lock:
            sys.stdout.write(data)
            sys.stdout.flush()
예제 #3
0
    def write_events(self, events):
        if not events:
            return

        stdout = sys.stdout

        with self._lock:
            for event in XMLEvent.format_events(events):
                stdout.write(event)
            stdout.flush()
예제 #4
0
    def create_event(self,
                     data,
                     time=None,
                     index=None,
                     host=None,
                     source=None,
                     sourcetype=None,
                     stanza=None,
                     unbroken=False,
                     done=False):
        '''Create a new XMLEvent object.
        '''

        return XMLEvent(data,
                        time=time,
                        index=index,
                        host=host,
                        source=source,
                        sourcetype=sourcetype,
                        stanza=stanza,
                        unbroken=unbroken,
                        done=done)