Skip to content

Commit

Permalink
Reset logging config before exiting (#800)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MarkZH authored Aug 9, 2023
1 parent eccfc26 commit 0dd5b0c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lichess-bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 0dd5b0c

Please sign in to comment.