File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -91,10 +91,12 @@ def enable_console_logging() -> None:
91
91
if logger and handler :
92
92
logger .addHandler (handler )
93
93
94
+
94
95
def flush_logger (logger : logging .Logger ):
95
96
for handler in logger .handlers :
96
97
handler .flush ()
97
98
99
+
98
100
def is_system_log_category (ctg : str ) -> bool :
99
101
"""Check if the logging namespace belongs to system logs. Category starts
100
102
with the following name will be treated as system logs.
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ def main():
47
47
48
48
import asyncio
49
49
50
-
51
50
from . import logging
52
51
from .logging import error_logger , format_exception , logger
53
52
@@ -70,6 +69,7 @@ def main():
70
69
format_exception (ex )))
71
70
raise
72
71
72
+
73
73
def register_sigterm_handler ():
74
74
import signal
75
75
"""
@@ -94,10 +94,10 @@ def handle_sigterm(signum, frame):
94
94
# Log the received signal
95
95
logger .info (f"SIGTERM received (signal: { signum } ). "
96
96
"Shutting down gracefully..." )
97
-
97
+
98
98
# Log the frame details to see whats executed when the signal was received
99
99
logger .info ("Frame details at signal receipt:"
100
- f"\n { '' .join (traceback .format_stack (frame ))} " )
100
+ f"\n { '' .join (traceback .format_stack (frame ))} " )
101
101
102
102
DispatcherMeta .__current_dispatcher__ = None
103
103
You can’t perform that action at this time.
0 commit comments