Skip to content
Snippets Groups Projects
Commit 401e6e06 authored by David Trattnig's avatar David Trattnig
Browse files

refact: slight debugging improvements

parent 48a3a7d6
No related branches found
No related tags found
No related merge requests found
...@@ -54,17 +54,20 @@ class AuraLogger: ...@@ -54,17 +54,20 @@ class AuraLogger:
Retrieve the configured log level (default=INFO). Retrieve the configured log level (default=INFO).
""" """
lvl = self.config.get("log_level") lvl = self.config.get("log_level")
mapping = {
if lvl == "debug": "debug": logging.DEBUG,
return logging.DEBUG "info": logging.INFO,
elif lvl == "info": "warning": logging.WARNING,
return logging.INFO "error": logging.ERROR,
elif lvl == "warning": "critical": logging.CRITICAL,
return logging.WARNING }
elif lvl == "error":
return logging.ERROR log_level = mapping.get(lvl)
else: if not log_level:
return logging.CRITICAL print("No log level configured. Using INFO.")
log_level = logging.INFO
print(f"Setting log level {log_level} ({lvl})")
return log_level
def create_logger(self, name, lvl): def create_logger(self, name, lvl):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment