From 20177860e0a99ca0e5865393cac53f2d5a5f5d6a Mon Sep 17 00:00:00 2001 From: Rory& Date: Sun, 19 Oct 2025 08:59:32 +0200 Subject: [PATCH] More env settings to tune down log noise --- src/api/routes/users/@me/settings-proto/1.ts | 9 +++++---- src/api/routes/users/@me/settings-proto/2.ts | 9 +++++---- src/gateway/opcodes/Identify.ts | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/api/routes/users/@me/settings-proto/1.ts b/src/api/routes/users/@me/settings-proto/1.ts index 2ae3a55b..a0559c26 100644 --- a/src/api/routes/users/@me/settings-proto/1.ts +++ b/src/api/routes/users/@me/settings-proto/1.ts @@ -166,10 +166,11 @@ async function patchUserSettings( }; } - console.log( - `Updating user settings for user ${userId} with atomic=${atomic}:`, - updatedSettings, - ); + if ((process.env.LOG_PROTO_UPDATES || process.env.LOG_PROTO_SETTINGS_UPDATES) && process.env.LOG_PROTO_SETTINGS_UPDATES !== "false") + console.log( + `Updating user settings for user ${userId} with atomic=${atomic}:`, + updatedSettings, + ); if (!atomic) { settings = PreloadedUserSettings.fromJson( diff --git a/src/api/routes/users/@me/settings-proto/2.ts b/src/api/routes/users/@me/settings-proto/2.ts index bfbcc81a..8335e219 100644 --- a/src/api/routes/users/@me/settings-proto/2.ts +++ b/src/api/routes/users/@me/settings-proto/2.ts @@ -168,10 +168,11 @@ async function patchUserSettings( }; } - console.log( - `Updating frecency settings for user ${userId} with atomic=${atomic}:`, - updatedSettings, - ); + if ((process.env.LOG_PROTO_UPDATES || process.env.LOG_PROTO_FRECENCY_UPDATES) && process.env.LOG_PROTO_FRECENCY_UPDATES !== "false") + console.log( + `Updating frecency settings for user ${userId} with atomic=${atomic}:`, + updatedSettings, + ); if (!atomic) { settings = FrecencyUserSettings.fromJson( diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts index 82b72f68..d304bc24 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts @@ -704,5 +704,5 @@ export async function onIdentify(this: WebSocket, data: Payload) { const setupListenerTime = Date.now(); - console.log(`[Gateway] IDENTIFY ${this.user_id} in ${totalSw.elapsed().totalMilliseconds}ms`, JSON.stringify(d._trace, null, 2)); + console.log(`[Gateway] IDENTIFY ${this.user_id} in ${totalSw.elapsed().totalMilliseconds}ms`, process.env.LOG_GATEWAY_TRACES ? JSON.stringify(d._trace, null, 2) : ""); }