From 641a032779d1a03081c540a4164c97f00919f15e Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Wed, 17 Jan 2024 21:29:24 +0000 Subject: [PATCH] use the logger when exception handling kicks in --- inkycal/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inkycal/main.py b/inkycal/main.py index a2145b1..08f55b1 100644 --- a/inkycal/main.py +++ b/inkycal/main.py @@ -212,14 +212,14 @@ class Inkycal: black.save(f"{self.image_folder}module{number}_black.png", "PNG") colour.save(f"{self.image_folder}module{number}_colour.png", "PNG") print('OK!') - except: + except Exception as e: errors.append(number) self.info += f"module {number}: Error! " - print('Error!') - print(traceback.format_exc()) + logger.error('Error!') + logger.error(f"Exception: {e}.") if errors: - print('Error/s in modules:', *errors) + logger.error('Error/s in modules:', *errors) del errors self._assemble()