diff libervia/desktop_kivy/core/cagou_main.py @ 497:232a723aae45

core: set log level according to configuration
author Goffi <goffi@goffi.org>
date Mon, 02 Oct 2023 17:20:13 +0200
parents b3cedbee561d
children 3b627382e681
line wrap: on
line diff
--- a/libervia/desktop_kivy/core/cagou_main.py	Fri Sep 01 16:04:24 2023 +0200
+++ b/libervia/desktop_kivy/core/cagou_main.py	Mon Oct 02 17:20:13 2023 +0200
@@ -425,6 +425,14 @@
         self._import_kv()
         self.app = LiberviaDesktopKivyApp()
         self.app.host = self
+        log_level = config.config_get(
+            main_config,
+            C.CONFIG_SECTION,
+            "log_level",
+            "INFO"
+        ).strip().upper()
+        root_logger = logging.getLogger()
+        root_logger.setLevel(log_level)
         self.media_dir = self.app.media_dir = config.config_get(main_config, '',
                                                                'media_dir')
         self.downloads_dir = self.app.downloads_dir = config.config_get(main_config, '',