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