From 5855b2ff5ce6ac319ca79d77cde6a7b5e9d51568 Mon Sep 17 00:00:00 2001 From: Christopher Baklid Date: Sun, 18 Feb 2018 09:42:34 +0100 Subject: attempt to fix stacktrace when initialising logger (#17) --- pysite/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pysite') 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 -- cgit v1.2.3