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:
parent
e2808e4026
commit
7762ad92f5
1 changed files with 2 additions and 2 deletions
4
main.py
4
main.py
|
@ -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.")
|
||||||
|
|
Loading…
Reference in a new issue