Skip to content

Commit

Permalink
update logging and requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
georgepstaylor committed Sep 25, 2023
1 parent 8e08058 commit f8620b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
18 changes: 7 additions & 11 deletions cli/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,15 @@ 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(
self,
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
Expand All @@ -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__)
Expand Down Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ldap3
oracledb==1.4
ansible-runner
PyGithub
GitPython
GitPython==3.1.37
pyjwt
python-dotenv
Jinja2
Expand Down

0 comments on commit f8620b4

Please sign in to comment.