Guest User

Untitled

a guest
Jun 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. def _reset(self):
  2. """Internal method; reopen the internal file handle (probably
  3. because the log file got rotated/truncated)."""
  4. self.f.close()
  5.  
  6. # modified by sarbajit
  7. localtime1 = localtime(time())
  8. year = str(localtime1[0])
  9. if localtime1[1] < 9:
  10. month = "0"+str(localtime1[1])
  11. else:
  12. month = str(localtime[1])
  13. if localtime1[2] > 9:
  14. date = str(localtime1[2])
  15. else:
  16. date = "0"+str(localtime1[2])
  17. logfile_name = "applog."+year+"-"+month+"-"+date+".log"
  18. self.path = "/var/log/" + logfile_name
  19. # end of modification
  20.  
  21. self.f = open(self.path, "r")
  22. self.pos = self.f.tell()
  23. self.last_read = time()
Add Comment
Please, Sign In to add comment