log_line.py
author Tero Marttila <terom@fixme.fi>
Mon, 09 Feb 2009 11:05:53 +0200
changeset 64 cdb6403c2498
parent 50 f13cf27a360b
child 86 645cf9c4441e
permissions -rw-r--r--
beginnings of a LogSearchIndex class
"""
    An IRC logfile consists of a series of lines/events
"""

class LogTypes :
    """
        Definitions of the various LogLines types
    """
    
    # unknown type, may or may not have a timestamp, no source, only data
    RAW         = 0x01

class LogLine (object) :
    """
        An event on some specific channel
    """

    # the offset, only garunteed to be unique for a specific channel and date
    offset = None

    # the event type, as defiend in LogTypes
    type = None

    # the UTC timestamp of the event
    timestamp = None

    # the event source
    source = None

    # associated data (message, etc)
    data = None
    
    def __init__ (self, offset, type, timestamp, source, data) :
        """
            Initialize with given values
        """
        
        self.offset = offset
        self.type = type
        self.timestamp = timestamp
        self.source = source
        self.data = data