Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a7a1659f0 | ||
|
|
bc23006a34 | ||
|
|
6090995eba | ||
|
|
60db747d6d | ||
|
|
a7a4141f58 | ||
|
|
2b04cbe239 |
@@ -1,7 +1,7 @@
|
||||
# MARK: Project info
|
||||
[project]
|
||||
name = "corelibs"
|
||||
version = "0.22.1"
|
||||
version = "0.22.4"
|
||||
description = "Collection of utils for Python scripts"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
|
||||
@@ -122,9 +122,6 @@ class LogParent:
|
||||
self.log_queue: 'Queue[str] | None' = None
|
||||
self.handlers: dict[str, Any] = {}
|
||||
|
||||
def __del__(self):
|
||||
self._cleanup()
|
||||
|
||||
# FIXME: we need to add a custom formater to add stack level listing if we want to
|
||||
# Important note, although they exist, it is recommended to use self.logger.NAME directly
|
||||
# so that the correct filename, method and row number is set
|
||||
@@ -286,8 +283,10 @@ class LogParent:
|
||||
return False
|
||||
return True
|
||||
|
||||
def _cleanup(self):
|
||||
"""cleanup for any open queues in case we have an abort"""
|
||||
def cleanup(self):
|
||||
"""
|
||||
cleanup for any open queues in case we have an abort
|
||||
"""
|
||||
if not self.log_queue:
|
||||
return
|
||||
self.flush()
|
||||
@@ -647,7 +646,7 @@ class Log(LogParent):
|
||||
if log_queue is None:
|
||||
return
|
||||
self.log_queue = log_queue
|
||||
atexit.register(self._cleanup)
|
||||
atexit.register(self.stop_listener)
|
||||
self.listener = logging.handlers.QueueListener(
|
||||
self.log_queue,
|
||||
*self.handlers.values(),
|
||||
|
||||
Reference in New Issue
Block a user