fix(logging): Move some logs from info to debug to avoid spam log

`Fetching notifications.` and `No new notifications.` are now under
`DEBUG`.
This commit is contained in:
Jiří Štefka 2025-01-14 10:59:18 +01:00
parent e2808e4026
commit 7762ad92f5
Signed by: jiriks74
GPG key ID: 1D5E30D3DB2264DE

View file

@ -147,7 +147,7 @@ def main():
"Accept": "application/json" "Accept": "application/json"
} }
while True: while True:
log.info("Fetching notifications.") log.debug("Fetching notifications.")
response = requests.get(f"{config["nextcloud_base_url"]}{config["nextcloud_notification_path"]}", headers = nextcloud_request_headers) response = requests.get(f"{config["nextcloud_base_url"]}{config["nextcloud_notification_path"]}", headers = nextcloud_request_headers)
if not response.ok: if not response.ok:
log.error(f"Error while fetching notifications. Response code: {response.status_code}.") log.error(f"Error while fetching notifications. Response code: {response.status_code}.")
@ -166,7 +166,7 @@ def main():
for notification in reversed(data["ocs"]["data"]): for notification in reversed(data["ocs"]["data"]):
if datetime.fromisoformat(notification["datetime"]) <= last_datetime: if datetime.fromisoformat(notification["datetime"]) <= last_datetime:
log.info("No new notifications.") log.debug("No new notifications.")
continue continue
last_datetime = datetime.fromisoformat(notification["datetime"]) last_datetime = datetime.fromisoformat(notification["datetime"])
log.info("New notifications received.") log.info("New notifications received.")