From 0dd5b0c6590ee7a3fb4f2766666bfca2cde43025 Mon Sep 17 00:00:00 2001 From: Mark Harrison Date: Wed, 9 Aug 2023 11:30:26 -0700 Subject: [PATCH] Reset logging config before exiting (#800) Because the main thread logs to a queue that is then handled by a listener process, terminating the listener process stops logging for the rest of the program. This means that, if lichess-bot is stopped by an exception, then the exception logging at the bottom of the file (line 1029) does not do anything. This change reverts the main thread back to direct logging before terminating the logging queue thread. --- lichess-bot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lichess-bot.py b/lichess-bot.py index 6fe6acf9a..9247d4cfb 100644 --- a/lichess-bot.py +++ b/lichess-bot.py @@ -250,6 +250,7 @@ def start(li: lichess.Lichess, user_profile: USER_PROFILE_TYPE, config: Configur control_stream.join() correspondence_pinger.terminate() correspondence_pinger.join() + logging_configurer(logging_level, log_filename, auto_log_filename, False) logging_listener.terminate() logging_listener.join()