From e1856c21a12f170c19a45aacf797fe165c9f7271 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Tue, 7 Feb 2023 08:24:36 -0800 Subject: [PATCH] add more logging for when we write Objects --- common.py | 2 ++ follow.py | 2 ++ webmention.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common.py b/common.py index 24e3472..53c78d2 100644 --- a/common.py +++ b/common.py @@ -328,6 +328,7 @@ def send_webmentions(activity_wrapped, proxy=None, **object_props): if activity.get('objectType') == 'activity': obj.labels.append('activity') obj.put() + logging.info(f'Created Object {source}') for target in targets: domain = util.domain_from_link(target.uri, minimize=False) @@ -362,6 +363,7 @@ def send_webmentions(activity_wrapped, proxy=None, **object_props): obj.status = 'complete' if obj.delivered else 'failed' if obj.failed else 'ignored' obj.put() + logging.info(f'Finalized Object {source} as {obj.status}') if errors: msg = 'Errors: ' + ', '.join(f'{code} {body}' for code, body in errors) diff --git a/follow.py b/follow.py index 2cbe6f7..f0b4d36 100644 --- a/follow.py +++ b/follow.py @@ -174,6 +174,7 @@ class FollowCallback(indieauth.Callback): source_protocol='ui', status='complete', as2=follow_json, as1=json_dumps(as2.to_as1(follow_as2), sort_keys=True), ).put() + logging.info(f'Wrote Object {follow_id}') link = common.pretty_link(util.get_url(followee) or id, text=addr) flash(f'Followed {link}.') @@ -244,6 +245,7 @@ class UnfollowCallback(indieauth.Callback): as2=json_dumps(unfollow_as2, sort_keys=True), as1=json_dumps(as2.to_as1(unfollow_as2), sort_keys=True), ).put() + logging.info(f'Wrote Object {unfollow_id}') link = common.pretty_link(util.get_url(followee) or followee_id) flash(f'Unfollowed {link}.') diff --git a/webmention.py b/webmention.py index 7052ce7..3f20b03 100644 --- a/webmention.py +++ b/webmention.py @@ -162,7 +162,7 @@ class Webmention(View): undelivered=[Target(uri=uri, protocol='activitypub') for uri in inboxes_to_targets.keys()], status='in progress') - logging.info(f'Storing new {obj}') + logging.info(f'Storing new Object {self.source_url}') obj.domains = [self.source_domain] obj.source_protocol = 'webmention'