Skip to content

Commit

Permalink
Ensure 'load-data' from podman compose up can log to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
jwmatthews committed Jul 19, 2024
1 parent 021c2f3 commit 301208d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions kai/service/incident_store/psql.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@ def json_exactly_equal(self, json_dict: dict):


if __name__ == "__main__":
log_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../../logs")
initLogging("INFO", "DEBUG", log_dir, "kai_psql.log")
if os.getenv("LOG_DIR") is not None:
log_dir = os.getenv("LOG_DIR")
else:
log_dir = os.path.join(
os.path.dirname(os.path.realpath(__file__)), "../../../logs"
)

if os.getenv("LOG_LEVEL") is not None:
log_level = os.getenv("LOG_LEVEL").upper()
else:
log_level = "INFO"

initLogging(log_level, "DEBUG", log_dir, "kai_psql.log")

cmd("postgresql")

0 comments on commit 301208d

Please sign in to comment.