Logo Search packages:      
Sourcecode: scanerrlog version File versions  Download package

def scanerrlog::ApacheErrorLog::read (   self  ) 

Reads an apache error_log file into the internal structure

Definition at line 951 of file scanerrlog.py.

00951                        :
                """Reads an apache error_log file into the internal structure"""
                while 1 :
                        lignes = self.__infile.readlines(100000)
                        if not lignes :
                                break
                        self._linestotal = self._linestotal + len(lignes)
                        for ligne in lignes :
                                 # Then we eat the End Of Line
                                 # we do the test in case of incomplete lines (cf. Python Library Reference)
                                 if ligne[-1] == '\n' :
                                         ligne = ligne[:-1]

                                 #
                                 # And we skip unwanted lines
                                 ok = self.__pattern.match(ligne)
                                 if ok and self.__includeseverity(ligne, ok.regs) :
                                         # and keep only the date and end of normal ones
                                         self.__append(self.__getdate(ligne, ok.regs), ligne[ok.end():])
                                 else :
                                         self._unwanted = self._unwanted + 1
                self.__read = 1

        def close(self) :


Generated by  Doxygen 1.6.0   Back to index