Skip to content

Commit f6a1d59

Browse files
authored
Merge pull request #7 from FusionSolutions/patch
Update to v0.1.4
2 parents b7be9a4 + bf81990 commit f6a1d59

4 files changed

Lines changed: 9 additions & 6 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.3"
2+
__version__ = "0.1.4"
33
__doc__ = """
44
Logging utility v{}
55
Copyright (C) 2021 Fusion Solutions KFT <contact@fusionsolutions.io>

fsLogger/loggerManager.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ def __init__(self, filter:Optional[Union[List[Any], str, Filter]]=None, messageF
4343
if hookSTDOut:
4444
sys.stdout = cast(TextIO, STDOutModule())
4545
atexit.register(self.close)
46-
def __del__(self) -> None:
47-
self.close()
48-
return None
4946
def getFilterData(self, name:str) -> Tuple[float, int]:
5047
return (
5148
self.filterChangeTime,

fsLogger/modules.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,13 @@ def sortFileNums(e:str) -> Tuple[int, str]:
151151
return int(r[0]), e
152152
else:
153153
return 0, e
154-
if os.path.isdir(os.path.dirname(self.fullPath)):
155-
return
154+
if not os.path.isdir(os.path.dirname(self.fullPath)):
155+
try:
156+
os.mkdir(os.path.dirname(self.fullPath), 0o770)
157+
except FileExistsError:
158+
pass
159+
if not os.path.isdir(os.path.dirname(self.fullPath)):
160+
return
156161
files:List[Tuple[int, str]] = sorted(list(map(sortFileNums, glob(self.fullPath+"*"))), key=lambda x: x[0], reverse=True)
157162
for n, f in files:
158163
os.rename(f, "{}.{:>03}".format(self.fullPath, n+1))

fsLogger/test/loggerManager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,5 @@ def test(self) -> None:
124124
getattr(Logger(lName), lvl)("ok")
125125
self.assertListEqual(mod.data, ["ok"] if s else [])
126126
mod.close()
127+
lm.close()
127128
return None

0 commit comments

Comments
 (0)