From 695528bed72825e19c7768966266a5dae0d7b7d9 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Wed, 11 Oct 2023 19:55:26 +0200 Subject: [PATCH] [mastodon-client] Log note lookup failures with logger instead of console --- packages/backend/src/server/api/mastodon/helpers/search.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/helpers/search.ts b/packages/backend/src/server/api/mastodon/helpers/search.ts index e86f48ffd..576810087 100644 --- a/packages/backend/src/server/api/mastodon/helpers/search.ts +++ b/packages/backend/src/server/api/mastodon/helpers/search.ts @@ -21,7 +21,7 @@ import { resolveUser } from "@/remote/resolve-user.js"; import { createNote } from "@/remote/activitypub/models/note.js"; import { getUser } from "@/server/api/common/getters.js"; import config from "@/config/index.js"; -import { MastoContext } from "@/server/api/mastodon/index.js"; +import { logger, MastoContext } from "@/server/api/mastodon/index.js"; export class SearchHelpers { public static async search(q: string | undefined, type: string | undefined, resolve: boolean = false, following: boolean = false, accountId: string | undefined, excludeUnreviewed: boolean = false, maxId: string | undefined, minId: string | undefined, limit: number = 20, offset: number | undefined, ctx: MastoContext): Promise { @@ -139,7 +139,7 @@ export class SearchHelpers { return isPost(object) ? createNote(getApId(object), resolver.reset(), true).then(p => p ? [p] : []) : []; } } catch (e: any) { - console.log(`[mastodon-client] resolve note '${q}' failed: ${e.message}`); + logger.warn(`Resolving note '${q}' failed: ${e.message}`); return []; } }