From 895a23769f9eb43efa3a78236d18bd5b01ae5b31 Mon Sep 17 00:00:00 2001 From: david-loe <56305409+david-loe@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:21:29 +0200 Subject: [PATCH] enhance logging --- frappe.py | 5 +++-- sync.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frappe.py b/frappe.py index 58e3447..fc97cd0 100644 --- a/frappe.py +++ b/frappe.py @@ -36,10 +36,11 @@ def send_data(self, method, endpoint, data): logging.error(f"Unbekannte HTTP-Methode: {method}") return None response.raise_for_status() - logging.info(f"Daten erfolgreich an {endpoint} gesendet.") + logging.info(f"Daten erfolgreich an {method} {endpoint} gesendet.") + logging.debug(f"{data}") return response.json() except requests.exceptions.RequestException as e: - logging.error(f"Fehler beim Senden der Daten an {endpoint}: {e}") + logging.error(f"Fehler beim Senden der Daten an {method} {endpoint}: {e}") return None def get_data(self, endpoint, params=None): diff --git a/sync.py b/sync.py index fda812d..c19152d 100644 --- a/sync.py +++ b/sync.py @@ -22,7 +22,7 @@ def __init__(self, config: Dict[str, Any]): def _load_tasks(self): tasks = [] for task_config in self.config.get("tasks", []): - task = SyncTask(task_config, self.db_conn, self.frappe_api) + task = SyncTask(task_config, self.db_conn, self.frappe_api, self.dry_run) tasks.append(task) return tasks