aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/configs/manager.py
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-10-04 13:36:59 +0800
committerAaron LI <aly@aaronly.me>2017-10-04 13:36:59 +0800
commita21fa84337356aeba294e00bbf63d19552d65553 (patch)
treefa7a1324d3e0050449caa8419142021f015f6b65 /fg21sim/configs/manager.py
parentfd40bc26b473c48dfecdc544ba9bb49cc2335737 (diff)
downloadfg21sim-a21fa84337356aeba294e00bbf63d19552d65553.tar.bz2
configs: Use lower case for logging levels
Diffstat (limited to 'fg21sim/configs/manager.py')
-rw-r--r--fg21sim/configs/manager.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py
index bfadab0..bbeabf7 100644
--- a/fg21sim/configs/manager.py
+++ b/fg21sim/configs/manager.py
@@ -519,15 +519,9 @@ class ConfigManager:
"""
Get and prepare the logging configurations for
``logging.basicConfig()`` to initialize the logging module.
-
- NOTE
- ----
- ``basicConfig()`` will automatically create a ``Formatter`` with the
- giving ``format`` and ``datefmt`` for each handlers if necessary,
- and then adding the handlers to the "root" logger.
"""
conf = self.get("logging")
- level = conf["level"]
+ level = conf["level"].upper()
if os.environ.get("DEBUG_FG21SIM"):
print("DEBUG: Force 'DEBUG' logging level", file=sys.stderr)
level = "DEBUG"
@@ -542,7 +536,7 @@ class ConfigManager:
if logfile:
handlers.append(FileHandler(logfile, mode=filemode))
- # Explicitly add formatter to each handler
+ # Explicitly add the formatter to each handler
formatter = logging.Formatter(fmt=conf["format"],
datefmt=conf["datefmt"])
for handler in handlers: