diff options
author | 2018-02-18 09:42:34 +0100 | |
---|---|---|
committer | 2018-02-18 09:42:33 +0100 | |
commit | 5855b2ff5ce6ac319ca79d77cde6a7b5e9d51568 (patch) | |
tree | fa623529a23b11598d29611c3efe4cd870d60274 /pysite/__init__.py | |
parent | Simple logging. (#16) (diff) |
attempt to fix stacktrace when initialising logger (#17)
Diffstat (limited to '')
-rw-r--r-- | pysite/__init__.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pysite/__init__.py b/pysite/__init__.py index 3e7aad42..a87e79d4 100644 --- a/pysite/__init__.py +++ b/pysite/__init__.py @@ -6,7 +6,6 @@ import os # region Logging # Get the log level from environment log_level = os.environ.get("LOG_LEVEL", "info").upper() -formatter = logging.Formatter('[%(asctime)s] [%(levelname)s] %(message)s') if hasattr(logging, log_level): log_level = getattr(logging, log_level) @@ -14,5 +13,5 @@ else: raise RuntimeError("LOG_LEVEL environment variable has an invalid value.") # This handler will ensure we log to stdout and stderr -logging.basicConfig(format=formatter, level=log_level) +logging.basicConfig(format='[%(asctime)s] [%(levelname)s] %(message)s', level=log_level) # endregion |