MCPcopy Index your code
hub / github.com/python/cpython / shouldRollover

Method shouldRollover

Lib/logging/handlers.py:367–384  ·  view source on GitHub ↗

Determine if rollover should occur. record is not used, as we are just comparing times, but it is needed so the method signatures are the same

(self, record)

Source from the content-addressed store, hash-verified

365 return result
366
367 def shouldRollover(self, record):
368 """
369 Determine if rollover should occur.
370
371 record is not used, as we are just comparing times, but it is needed so
372 the method signatures are the same
373 """
374 t = int(time.time())
375 if t >= self.rolloverAt:
376 # See #89564: Never rollover anything other than regular files
377 if os.path.exists(self.baseFilename) and not os.path.isfile(self.baseFilename):
378 # The file is not a regular file, so do not rollover, but do
379 # set the next rollover time to avoid repeated checks.
380 self.rolloverAt = self.computeRollover(t)
381 return False
382
383 return True
384 return False
385
386 def getFilesToDelete(self):
387 """

Callers 1

Calls 4

computeRolloverMethod · 0.95
timeMethod · 0.45
existsMethod · 0.45
isfileMethod · 0.45

Tested by 1