logging-ext2 0.2.4__py3-none-any.whl → 0.2.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- logging_ext2/__about__.py +1 -1
- logging_ext2/handlers.py +5 -1
- {logging_ext2-0.2.4.dist-info → logging_ext2-0.2.5.dist-info}/METADATA +1 -1
- logging_ext2-0.2.5.dist-info/RECORD +8 -0
- logging_ext2-0.2.4.dist-info/RECORD +0 -8
- {logging_ext2-0.2.4.dist-info → logging_ext2-0.2.5.dist-info}/WHEEL +0 -0
- {logging_ext2-0.2.4.dist-info → logging_ext2-0.2.5.dist-info}/licenses/LICENSE +0 -0
logging_ext2/__about__.py
CHANGED
logging_ext2/handlers.py
CHANGED
@@ -58,6 +58,7 @@ class TimedRotatingFileHandler(Handler):
|
|
58
58
|
def do_rollover(self):
|
59
59
|
if self.filepath.exists():
|
60
60
|
self.stream.close()
|
61
|
+
self.stream = self.init_stream()
|
61
62
|
paths: List[Path] = [
|
62
63
|
i
|
63
64
|
for i in self.base_dir.iterdir()
|
@@ -66,10 +67,14 @@ class TimedRotatingFileHandler(Handler):
|
|
66
67
|
paths.sort(key=lambda x: x.name, reverse=True)
|
67
68
|
to_delete: Path
|
68
69
|
for to_delete in paths[self.max_keep:]:
|
70
|
+
if to_delete == self.filepath:
|
71
|
+
continue
|
69
72
|
to_delete.unlink(missing_ok=True)
|
70
73
|
for to_gzip_path in paths[self.flat_keep:self.max_keep]:
|
71
74
|
# here use the system gzip command to ignore exceptions like
|
72
75
|
# permission denied or file not found
|
76
|
+
if to_gzip_path == self.filepath:
|
77
|
+
continue
|
73
78
|
try:
|
74
79
|
if not to_gzip_path.stat().st_size:
|
75
80
|
to_gzip_path.unlink(missing_ok=True)
|
@@ -90,4 +95,3 @@ class TimedRotatingFileHandler(Handler):
|
|
90
95
|
).with_suffix(".gz"))
|
91
96
|
cmds = ["gzip", to_gzip_path]
|
92
97
|
subprocess.run(cmds)
|
93
|
-
self.stream = self.init_stream()
|
@@ -0,0 +1,8 @@
|
|
1
|
+
logging_ext2/__about__.py,sha256=5S33mBG07NClCl4iUi5Wy-ACpn1ukuHg74gcRj2V8IA,121
|
2
|
+
logging_ext2/__init__.py,sha256=BA6rgdmh3z2v01cbHU1FRMsBIRV5vQjh2w9FzG2F2GY,99
|
3
|
+
logging_ext2/handlers.py,sha256=LUL0qWoj0eTlBHlot0cMxIkQ4XTH1TFJcl3jsdLfMxs,3440
|
4
|
+
logging_ext2/types.py,sha256=cLjODjTgxrZEXUZzOkrFm3s6bUG3Itc_fS7KJ-MSWC8,237
|
5
|
+
logging_ext2-0.2.5.dist-info/METADATA,sha256=0egTE1kaQdRrMOmwNeW8_BSUBv0_KVUIBfQzEQy9IKA,1453
|
6
|
+
logging_ext2-0.2.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
7
|
+
logging_ext2-0.2.5.dist-info/licenses/LICENSE,sha256=RckqF9bdq7oO9RrL4iZYuXNhkIcXexbXNF2ToiaJymU,1067
|
8
|
+
logging_ext2-0.2.5.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
logging_ext2/__about__.py,sha256=-MvhEn10ANMYbo0dJNnemdwJcdTb5ZdoQzP842QKWd4,121
|
2
|
-
logging_ext2/__init__.py,sha256=BA6rgdmh3z2v01cbHU1FRMsBIRV5vQjh2w9FzG2F2GY,99
|
3
|
-
logging_ext2/handlers.py,sha256=xaeeJKt8mNV404XZFSImaKQie_eg0FSL-21eFnqDJ5c,3301
|
4
|
-
logging_ext2/types.py,sha256=cLjODjTgxrZEXUZzOkrFm3s6bUG3Itc_fS7KJ-MSWC8,237
|
5
|
-
logging_ext2-0.2.4.dist-info/METADATA,sha256=SdPhAGWpX7cGVp_D39Euh_ECEWR6eiQnmiH_rarABLk,1453
|
6
|
-
logging_ext2-0.2.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
7
|
-
logging_ext2-0.2.4.dist-info/licenses/LICENSE,sha256=RckqF9bdq7oO9RrL4iZYuXNhkIcXexbXNF2ToiaJymU,1067
|
8
|
-
logging_ext2-0.2.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|