From 208f0734f384a2d8428c2c0435edc94380f17f57 Mon Sep 17 00:00:00 2001 From: "Marten B. Scheuck" <58522505+MBSck@users.noreply.github.com> Date: Fri, 23 Feb 2024 10:34:41 +0100 Subject: [PATCH] Make log work --- p2obp/backend/options.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/p2obp/backend/options.py b/p2obp/backend/options.py index 49e4066..ee81923 100644 --- a/p2obp/backend/options.py +++ b/p2obp/backend/options.py @@ -128,6 +128,11 @@ log=log, resolution=resolution, photometry=photometry, w0=w0, dit=dit, constraints=constraints, catalogs=catalogs) + +OPTIONS.log.path.mkdir(parents=True, exist_ok=True) +with open(OPTIONS.log.path / "p2obp.log", "w+") as log_file: + log_file.write("Start of log:") + logging.basicConfig(filename=OPTIONS.log.path / "p2obp.log", filemode="w", level=OPTIONS.log.level, format=OPTIONS.log.format)