🎨 Better logging init

This commit is contained in:
GeoffreyCoulaud
2023-05-27 19:39:52 +02:00
parent 12ad5c598e
commit e7fa20e4d4

View File

@@ -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)