mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -04:00
directnotify: Fix RotatingLog filePath error when sizeLimit is None
This commit is contained in:
parent
2c727940ae
commit
c63a92bdec
@ -55,10 +55,11 @@ class RotatingLog:
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
def filePath(self):
|
def filePath(self):
|
||||||
dateString=time.strftime("%Y_%m_%d_%H", time.localtime())
|
dateString = time.strftime("%Y_%m_%d_%H", time.localtime())
|
||||||
for i in range(26):
|
for i in range(26):
|
||||||
path="%s_%s_%s.log"%(self.path, dateString, chr(i+97))
|
limit = self.sizeLimit
|
||||||
if not os.path.exists(path) or os.stat(path)[6] < self.sizeLimit:
|
path = "%s_%s_%s.log" % (self.path, dateString, chr(i+97))
|
||||||
|
if limit is None not os.path.exists(path) or os.stat(path)[6] < limit:
|
||||||
return path
|
return path
|
||||||
# Hmm, 26 files are full? throw the rest in z:
|
# Hmm, 26 files are full? throw the rest in z:
|
||||||
# Maybe we should clear the self.sizeLimit here... maybe.
|
# Maybe we should clear the self.sizeLimit here... maybe.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user