From 1620668d5aebc50fe8b33c86864b7e31fcc8228b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 1 Jan 2024 17:02:09 -0600 Subject: [PATCH] debug: log events signed through the API --- src/utils/web.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/web.ts b/src/utils/web.ts index a782299..9a3eaf0 100644 --- a/src/utils/web.ts +++ b/src/utils/web.ts @@ -2,6 +2,7 @@ import { type AppContext } from '@/app.ts'; import { Conf } from '@/config.ts'; import { type Context, + Debug, type Event, EventTemplate, Filter, @@ -15,6 +16,8 @@ import { signAdminEvent, signEvent } from '@/sign.ts'; import { nostrNow } from '@/utils.ts'; import { eventsDB } from '@/db/events.ts'; +const debug = Debug('ditto:api'); + /** EventTemplate with defaults. */ type EventStub = TypeFest.SetOptional, 'content' | 'created_at' | 'tags'>; @@ -79,6 +82,7 @@ async function createAdminEvent(t: EventStub, c: AppContext /** Push the event through the pipeline, rethrowing any RelayError. */ async function publishEvent(event: Event, c: AppContext): Promise> { + debug('EVENT', event); try { await pipeline.handleEvent(event); } catch (e) {