diff --git a/cli/logger.py b/cli/logger.py index f4c84f1..16afdf1 100644 --- a/cli/logger.py +++ b/cli/logger.py @@ -15,9 +15,7 @@ def __init__( fmt=format_str, datefmt=datefmt_str, ) - self._secrets_set = set( - cli.env.secrets.values() - ) # Retrieve secrets set here + self._secrets_set = set(cli.env.secrets.values()) # Retrieve secrets set here self.default_msec_format = "%s.%03d" def _filter( @@ -25,10 +23,7 @@ def _filter( s, ): redacted = " ".join( - [ - "*" * len(string) if string in self._secrets_set else string - for string in s.split(" ") - ] + ["*" * len(string) if string in self._secrets_set else string for string in s.split(" ")] ) return redacted @@ -42,10 +37,7 @@ def format( print("configure_logging") """Configure logging based on environment variables.""" - format = ( - cli.env.vars.get("LOG_FORMAT") - or "%(asctime)s.%(msecs)03d - %(levelname)s: %(message)s" - ) + format = cli.env.vars.get("LOG_FORMAT") or "%(asctime)s.%(msecs)03d - %(levelname)s: %(message)s" datefmt = cli.env.vars.get("LOG_DATE_FORMAT") or "%Y-%m-%d %H:%M:%S" log = logging.getLogger(__name__) @@ -73,6 +65,10 @@ def format( elif cli.env.vars.get("LOG_LEVEL") == "INFO": print("INFO") log.setLevel(logging.INFO) + else: + print("No LOG_LEVEL set, defaulting to INFO") + print("INFO") + log.setLevel(logging.INFO) return True diff --git a/requirements.txt b/requirements.txt index 3888448..79a4e4b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ ldap3 oracledb==1.4 ansible-runner PyGithub -GitPython +GitPython==3.1.37 pyjwt python-dotenv Jinja2