Loading src/l3_distributedattackdetector/service/l3_distributedattackdetector.py +4 −4 Original line number Original line Diff line number Diff line Loading @@ -106,20 +106,20 @@ class l3_distributedattackdetector: LOGGER.info("Gracefully stopping...") LOGGER.info("Gracefully stopping...") def follow(self, file, time_sleep): def follow(self, logfile, time_sleep): """ """ Generator function that yields new lines in a file Generator function that yields new lines in a log file """ """ # seek the end of the file # seek the end of the file # file.seek(0, os.SEEK_END) # logfile.seek(0, os.SEEK_END) chunk = "" chunk = "" # start an infinite loop # start an infinite loop while True: while True: # read last line of the file # read last line of the file line = file.readline() line = logfile.readline() # sleep if the file hasn't been updated # sleep if the file hasn't been updated if not line: if not line: Loading Loading
src/l3_distributedattackdetector/service/l3_distributedattackdetector.py +4 −4 Original line number Original line Diff line number Diff line Loading @@ -106,20 +106,20 @@ class l3_distributedattackdetector: LOGGER.info("Gracefully stopping...") LOGGER.info("Gracefully stopping...") def follow(self, file, time_sleep): def follow(self, logfile, time_sleep): """ """ Generator function that yields new lines in a file Generator function that yields new lines in a log file """ """ # seek the end of the file # seek the end of the file # file.seek(0, os.SEEK_END) # logfile.seek(0, os.SEEK_END) chunk = "" chunk = "" # start an infinite loop # start an infinite loop while True: while True: # read last line of the file # read last line of the file line = file.readline() line = logfile.readline() # sleep if the file hasn't been updated # sleep if the file hasn't been updated if not line: if not line: Loading