Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _reset(self):
- """Internal method; reopen the internal file handle (probably
- because the log file got rotated/truncated)."""
- self.f.close()
- # modified by sarbajit
- localtime1 = localtime(time())
- year = str(localtime1[0])
- if localtime1[1] < 9:
- month = "0"+str(localtime1[1])
- else:
- month = str(localtime[1])
- if localtime1[2] > 9:
- date = str(localtime1[2])
- else:
- date = "0"+str(localtime1[2])
- logfile_name = "applog."+year+"-"+month+"-"+date+".log"
- self.path = "/var/log/" + logfile_name
- # end of modification
- self.f = open(self.path, "r")
- self.pos = self.f.tell()
- self.last_read = time()
Add Comment
Please, Sign In to add comment