From 3d41be76515528fe5eda2f01aeeb0b9c974206b5 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 12 Jan 2023 14:50:44 +0000 Subject: [PATCH] monitor: log INFO when for-plugins `StartUp` event synthesized This is actually to do with a reported issue around the ctypes code in `EDLogs.gamerunning()` causing: ```python exception ignored on calling ctypes callback function: .callback at 0x0000020E9C9D0EA0> Traceback (most recent call last): File "monitor.pyc", line 2041, in callback File "monitor.pyc", line 2034, in WindowTitle ctypes.ArgumentError: argument 1: OverflowError: int too long to convert ``` Although I can't personally get this to trigger at all under 64-bit python, either in PyCharm *or* with the 5.7.1-alpha1 64-bit pre-release. `game_running()` is only used in a few places, and the key things it malfunctioning might cause are lack of the synthetic `ShutDown` (already has an INFO logging) and `StartUp` events. --- monitor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/monitor.py b/monitor.py index 126e04c7..049e75da 100644 --- a/monitor.py +++ b/monitor.py @@ -415,6 +415,7 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below if self.live: if self.game_was_running: + logger.info("Game is/was running, so synthesizing StartUp event for plugins") # Game is running locally entry: OrderedDictT[str, Any] = OrderedDict([ ('timestamp', strftime('%Y-%m-%dT%H:%M:%SZ', gmtime())),