Skip to content

Commit b9bc056

Browse files
authored
Merge pull request #8 from FusionSolutions/patch
Update to v0.1.5
2 parents f6a1d59 + e762ac5 commit b9bc056

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

fsLogger/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from __future__ import annotations
2-
__version__ = "0.1.4"
2+
__version__ = "0.1.5"
33
__doc__ = """
44
Logging utility v{}
55
Copyright (C) 2021 Fusion Solutions KFT <contact@fusionsolutions.io>

fsLogger/modules.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ def sortFileNums(e:str) -> Tuple[int, str]:
160160
return
161161
files:List[Tuple[int, str]] = sorted(list(map(sortFileNums, glob(self.fullPath+"*"))), key=lambda x: x[0], reverse=True)
162162
for n, f in files:
163-
os.rename(f, "{}.{:>03}".format(self.fullPath, n+1))
163+
if self.maxBackup is not None and self.maxBackup <= n+1:
164+
os.remove(f)
165+
else:
166+
os.rename(f, "{}.{:>03}".format(self.fullPath, n+1))
164167

165168
class DailyFileStream(FileStream):
166169
path:str

0 commit comments

Comments
 (0)