feat: log level from environment is recognised case-insensitively

Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
This commit is contained in:
Christopher Arndt 2023-07-23 18:02:03 +02:00
parent d3579b6e0f
commit da31628d86
1 changed files with 1 additions and 3 deletions

View File

@ -141,9 +141,7 @@ def main(args=None):
args = ap.parse_args(args)
logging.basicConfig(
level=getattr(
logging, "DEBUG" if args.verbose else os.environ.get("PLUGIN_LOG_LEVEL", "INFO")
),
level="DEBUG" if args.verbose else os.environ.get("PLUGIN_LOG_LEVEL", "INFO").upper(),
format=os.environ.get("PLUGIN_LOG_FORMAT", "%(levelname)s: %(message)s"),
)