コード例 #1
0
ファイル: messageReceiver.py プロジェクト: Bultako/TAPAS
    def parseLoglineAux(self,line):
        """Aux method: Parses a line read"""

        subLine = line[string.find(line,"<"):]
        self.line = subLine
        
        lm = LogMessage()
        try:
            lm.parse(subLine)
            logId = self.getDictValue(lm.attributes,"LogId","unknown")
            timeStamp = self.getDictValue(lm.attributes,"TimeStamp","no time")
            if Debug>1: print ". logId: %s" % logId
            if Debug>1: lm.dump()
        except:
            print >> sys.stderr, ". parse error for: ", subLine
            raise 'ParseError'

        return lm
コード例 #2
0
ファイル: messageReceiver.py プロジェクト: Bultako/TAPAS
 def parseLogline(self,line):
     """Parses a line read from the input choosen and returns a logMessage class"""
 
     subLine = line[string.find(line,"<"):]
     subLine = subLine[:string.rfind(subLine,">")+1]
     
     lm = LogMessage()
     try:
         lm.parse(subLine)
         logId = self.getDictValue(lm.attributes,"LogId","unknown")
         timeStamp = self.getDictValue(lm.attributes,"TimeStamp","no time")
         if Debug>1: print ". logId: %s" % logId
         if Debug>1: lm.dump()
     except:
         print ". parse error for: ", subLine
         raise 'ParseError'
 
     return lm