Skip to content

Commit

Permalink
enhance logging
Browse files Browse the repository at this point in the history
  • Loading branch information
david-loe committed Oct 18, 2024
1 parent e6d8190 commit 895a237
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions frappe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 895a237

Please sign in to comment.