More fixes for the queue clean up
Changed that we call stop_listener and not _cleanup on exit Then call _cleanup from the stop listener We only need that if we have listeners (queue) anyway
This commit is contained in:
@@ -644,7 +644,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(),
|
||||
@@ -659,6 +659,7 @@ class Log(LogParent):
|
||||
if self.listener is not None:
|
||||
self.flush()
|
||||
self.listener.stop()
|
||||
self._cleanup()
|
||||
|
||||
# MARK: init main log
|
||||
def __init_log(self, log_name: str) -> None:
|
||||
|
||||
Reference in New Issue
Block a user