Beispiel #1
0
 def test_seek_first_unprocessed_position_no_progress_file(self):
     self.write_log_file('2000-01-01 00:00:00,000 FlowID ERROR Thread C.m(C.java:23): Error! Nooooo!\n' * 20)
     with open('log.log', 'rb') as f:
         reader = LogReader(0, 'log.log', Log4jParser(), FakeReceiver(), progress_file_path_prefix='progress', tail_length=10)
         reader.logfile = f
         reader._seek_first_unprocessed_position()
         self.assertEqual(f.tell(), 0)
         self.assertEqual(self.fake_logging.log, ['[WARN] Failed to read the progress file for "log.log".'])
Beispiel #2
0
 def test_seek_first_unprocessed_position(self):
     self.write_log_file('XXXX\n' * 100)
     self.write_progress_file('log.log 123g456 50 75')
     with open('log.log', 'rb') as f:
         reader = LogReader(0, 'log.log', Log4jParser(), FakeReceiver(), progress_file_path_prefix='progress')
         reader.logfile = f
         reader._seek_first_unprocessed_position()
         self.assertEqual(f.tell(), 50)
         self.assertEqual(reader.logfile_id, '123g456')