From 6008ff516ec46ecd6eb7354d762497815269338b Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 8 Jun 2022 18:32:41 +0200 Subject: [PATCH] Improve logging (#671) --- changedetectionio/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index c285f99a..cb7066b3 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -20,6 +20,7 @@ from copy import deepcopy from threading import Event import flask_login +import logging import pytz import timeago from feedgen.feed import FeedGenerator @@ -1195,7 +1196,8 @@ def changedetection_app(config=None, datastore_o=None): except Exception as e: - flash("Could not share, something went wrong while communicating with the share server.", 'error') + logging.error("Error sharing -{}".format(str(e))) + flash("Could not share, something went wrong while communicating with the share server - {}".format(str(e)), 'error') # https://changedetection.io/share/VrMv05wpXyQa # in the browser - should give you a nice info page - wtf @@ -1257,7 +1259,7 @@ def notification_runner(): notification.process_notification(n_object, datastore) except Exception as e: - print("Watch URL: {} Error {}".format(n_object['watch_url'], str(e))) + logging.error("Watch URL: {} Error {}".format(n_object['watch_url'], str(e))) # UUID wont be present when we submit a 'test' from the global settings if 'uuid' in n_object: