From e7fa20e4d4b1fc33f9bfc6006aa008c5859973a4 Mon Sep 17 00:00:00 2001 From: GeoffreyCoulaud Date: Sat, 27 May 2023 19:39:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Better=20logging=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 1511815..e8d68e7 100644 --- a/src/main.py +++ b/src/main.py @@ -238,7 +238,10 @@ class CartridgesApplication(Adw.Application): def main(version): # pylint: disable=unused-argument - log_level = os.environ.get("LOGLEVEL", "ERROR").upper() - logging.basicConfig(level="INFO") # TODO remove before release, use env + # Initiate logger + default_log_level = "DEBUG" if shared.PROFILE == "development" else "WARNING" + log_level = os.environ.get("LOGLEVEL", default_log_level).upper() + logging.basicConfig(level=log_level) + # Start app app = CartridgesApplication() return app.run(sys.argv)