SwiftGUI_Logging 0.1.2__tar.gz → 0.1.3__tar.gz
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.
- {swiftgui_logging-0.1.2 → swiftgui_logging-0.1.3}/PKG-INFO +2 -2
- {swiftgui_logging-0.1.2 → swiftgui_logging-0.1.3}/README.md +1 -1
- {swiftgui_logging-0.1.2 → swiftgui_logging-0.1.3}/pyproject.toml +1 -1
- {swiftgui_logging-0.1.2 → swiftgui_logging-0.1.3}/src/SwiftGUI_Logging/MemoryHandlerRotatingBuffer.py +11 -3
- {swiftgui_logging-0.1.2 → swiftgui_logging-0.1.3}/LICENSE +0 -0
- {swiftgui_logging-0.1.2 → swiftgui_logging-0.1.3}/src/SwiftGUI_Logging/Configs/ExceptionLogging.py +0 -0
- {swiftgui_logging-0.1.2 → swiftgui_logging-0.1.3}/src/SwiftGUI_Logging/Configs/__init__.py +0 -0
- {swiftgui_logging-0.1.2 → swiftgui_logging-0.1.3}/src/SwiftGUI_Logging/ExceptionHandling.py +0 -0
- {swiftgui_logging-0.1.2 → swiftgui_logging-0.1.3}/src/SwiftGUI_Logging/Utils.py +0 -0
- {swiftgui_logging-0.1.2 → swiftgui_logging-0.1.3}/src/SwiftGUI_Logging/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SwiftGUI_Logging
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: A collection of helpful logging-functionality based on the logging package
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -84,7 +84,7 @@ After the program executes, the directory contains a file like
|
|
|
84
84
|
As you can see, the time of the crash was inserted into the
|
|
85
85
|
filename, so that multiple crashlogs don't overwrite each other.
|
|
86
86
|
|
|
87
|
-
The file contains the most recent log-entries (from `logging.debug`)
|
|
87
|
+
The file contains the most recent log-entries (from `logging.debug` and `logging.info`)
|
|
88
88
|
and the exception with full traceback:
|
|
89
89
|
```log
|
|
90
90
|
2026-02-24 16:33:49,940 - root - DEBUG - Test 0
|
|
@@ -68,7 +68,7 @@ After the program executes, the directory contains a file like
|
|
|
68
68
|
As you can see, the time of the crash was inserted into the
|
|
69
69
|
filename, so that multiple crashlogs don't overwrite each other.
|
|
70
70
|
|
|
71
|
-
The file contains the most recent log-entries (from `logging.debug`)
|
|
71
|
+
The file contains the most recent log-entries (from `logging.debug` and `logging.info`)
|
|
72
72
|
and the exception with full traceback:
|
|
73
73
|
```log
|
|
74
74
|
2026-02-24 16:33:49,940 - root - DEBUG - Test 0
|
|
@@ -20,6 +20,7 @@ class MemoryHandlerRotatingBuffer(logging.handlers.MemoryHandler):
|
|
|
20
20
|
"""
|
|
21
21
|
super().__init__(capacity, flushLevel, target, flushOnClose=False)
|
|
22
22
|
self.call_after_flushing = call_after_flushing if call_after_flushing else lambda *_:_
|
|
23
|
+
self._should_flush = False
|
|
23
24
|
|
|
24
25
|
def shouldFlush(self, record):
|
|
25
26
|
"""
|
|
@@ -30,10 +31,17 @@ class MemoryHandlerRotatingBuffer(logging.handlers.MemoryHandler):
|
|
|
30
31
|
if len(self.buffer) > self.capacity: # Remove 0th element so the buffer doesn't "overflow"
|
|
31
32
|
self.buffer.pop(0)
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
if record.levelno >= self.flushLevel:
|
|
35
|
+
self._should_flush = True
|
|
36
|
+
return True
|
|
37
|
+
|
|
38
|
+
return False
|
|
34
39
|
|
|
35
40
|
def flush(self):
|
|
36
|
-
super().flush()
|
|
37
|
-
|
|
41
|
+
super().flush() # Don't put this in the if, this is necessary due to Python-magic...
|
|
42
|
+
|
|
43
|
+
if self._should_flush:
|
|
44
|
+
self.call_after_flushing()
|
|
45
|
+
self._should_flush = False
|
|
38
46
|
|
|
39
47
|
|
|
File without changes
|
{swiftgui_logging-0.1.2 → swiftgui_logging-0.1.3}/src/SwiftGUI_Logging/Configs/ExceptionLogging.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|