kopia lustrzana https://github.com/snarfed/bridgy-fed
prune more logging messages
rodzic
0cbcf81ecc
commit
a2376f8f14
|
@ -1001,7 +1001,7 @@ def inbox(protocol=None, id=None):
|
|||
type = activity.get('type')
|
||||
actor = as1.get_object(activity, 'actor')
|
||||
actor_id = actor.get('id')
|
||||
logger.info(f'Got {type} from {actor_id}: {json_dumps(activity, indent=2)}')
|
||||
logger.info(f'Got {type} {activity.get("id")} from {actor_id}')
|
||||
|
||||
if ActivityPub.is_blocklisted(actor_id):
|
||||
error(f'Actor {actor_id} is blocklisted')
|
||||
|
|
|
@ -354,7 +354,7 @@ class ATProto(User, Protocol):
|
|||
# create user profile
|
||||
profile = cls.convert(user.obj, fetch_blobs=True, from_user=user)
|
||||
profile_json = json_dumps(dag_json.encode(profile).decode(), indent=2)
|
||||
logger.info(f'Storing ATProto app.bsky.actor.profile self: {profile_json}')
|
||||
logger.info(f'Storing ATProto app.bsky.actor.profile self')
|
||||
initial_writes = [Write(
|
||||
action=Action.CREATE, collection='app.bsky.actor.profile',
|
||||
rkey='self', record=profile)]
|
||||
|
@ -469,7 +469,7 @@ class ATProto(User, Protocol):
|
|||
assert copy_did == did, (copy_did, did)
|
||||
assert coll == type, (coll, type)
|
||||
|
||||
logger.info(f'Storing ATProto {action} {type} {rkey}: {dag_json.encode(record).decode()}')
|
||||
logger.info(f'Storing ATProto {action} {type} {rkey}')
|
||||
repo.apply_writes([Write(action=action, collection=type, rkey=rkey,
|
||||
record=record)])
|
||||
|
||||
|
|
26
models.py
26
models.py
|
@ -878,22 +878,7 @@ class Object(StringIdModel):
|
|||
def _post_put_hook(self, future):
|
||||
"""Update :meth:`Protocol.load` cache."""
|
||||
# TODO: assert that as1 id is same as key id? in pre put hook?
|
||||
|
||||
# log, pruning data fields
|
||||
props = util.trim_nulls({
|
||||
**self.to_dict(),
|
||||
'new': self.new,
|
||||
'changed': self.changed,
|
||||
})
|
||||
for prop in ['as2', 'atom', 'bsky', 'delivered', 'failed', 'mf2', 'mod',
|
||||
'our_as1', 'private_exponent', 'public_exponent', 'raw',
|
||||
'rss', 'undelivered']:
|
||||
if props.get(prop):
|
||||
props[prop] = "..."
|
||||
for prop in 'created', 'updated', 'as1', 'expire':
|
||||
props.pop(prop, None)
|
||||
|
||||
logger.info(f'Wrote {self.key} {props}')
|
||||
logger.info(f'Wrote {self.key}')
|
||||
|
||||
if '#' not in self.key.id():
|
||||
import protocol # TODO: actually fix this circular import
|
||||
|
@ -1295,14 +1280,7 @@ class Follower(ndb.Model):
|
|||
assert self.from_.kind() != self.to.kind(), f'from {self.from_} to {self.to}'
|
||||
|
||||
def _post_put_hook(self, future):
|
||||
# log, pruning data fields
|
||||
props = util.trim_nulls(self.to_dict())
|
||||
if props.get('follow'):
|
||||
props['follow'] = "..."
|
||||
for prop in 'created', 'updated':
|
||||
props.pop(prop, None)
|
||||
|
||||
logger.info(f'Wrote {self.key} {props}')
|
||||
logger.info(f'Wrote {self.key}')
|
||||
|
||||
@classmethod
|
||||
@ndb.transactional()
|
||||
|
|
|
@ -1584,8 +1584,6 @@ def send_task():
|
|||
target = Target(uri=url, protocol=protocol)
|
||||
|
||||
obj = ndb.Key(urlsafe=form['obj']).get()
|
||||
logger.info(f'Sending {obj.key.id()} AS1: {json_dumps(obj.as1, indent=2)}')
|
||||
|
||||
if (target not in obj.undelivered and target not in obj.failed
|
||||
and 'force' not in request.values):
|
||||
logger.info(f"{url} not in {obj.key.id()} undelivered or failed, giving up")
|
||||
|
@ -1598,6 +1596,7 @@ def send_task():
|
|||
if form.get('orig_obj') else None)
|
||||
|
||||
# send
|
||||
logger.info(f'Sending {obj.key.id()} AS1: {json_dumps(obj.as1, indent=2)}')
|
||||
sent = None
|
||||
try:
|
||||
sent = PROTOCOLS[protocol].send(obj, url, from_user=user, orig_obj=orig_obj)
|
||||
|
|
2
web.py
2
web.py
|
@ -483,7 +483,7 @@ class Web(User, Protocol):
|
|||
entry = mf2util.representative_hcard(parsed, parsed['url'])
|
||||
if not entry:
|
||||
error(f"Couldn't find a representative h-card (http://microformats.org/wiki/representative-hcard-parsing) on {parsed['url']}")
|
||||
logger.info(f'Representative h-card: {json_dumps(entry, indent=2)}')
|
||||
logger.info(f'Found representative h-card')
|
||||
else:
|
||||
entry = mf2util.find_first_entry(parsed, ['h-entry'])
|
||||
if not entry:
|
||||
|
|
|
@ -265,7 +265,7 @@ def fetch(addr):
|
|||
flash(f'WebFinger on {addr_domain} returned non-JSON')
|
||||
return None
|
||||
|
||||
logger.info(f'Got: {json_dumps(data, indent=2)}')
|
||||
logger.info(f'Got WebFinger for {addr}')
|
||||
return data
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue