From afdc8aa7af4c7a67a6eb15cbdc724523f0dcc2de Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Tue, 5 Jul 2022 04:46:40 +0200 Subject: [PATCH] feat(config): Get log level from environment --- update-firewall-source.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/update-firewall-source.py b/update-firewall-source.py index 4872eb3..55c1fd0 100644 --- a/update-firewall-source.py +++ b/update-firewall-source.py @@ -83,7 +83,9 @@ logging.basicConfig( ) log = logging.getLogger("rich") # Our own code logs with this level -log.setLevel(logging.DEBUG) +log.setLevel(os.environ.get("UFS_LOGLEVEL") if "UFS_LOGLEVEL" in [k for k, v in os.environ.items()] else logging.INFO) + +p = inflect.engine() # Use this version of class ConfigParser to log.debug contents of our config file. When parsing sections other than