summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-10-19 08:59:32 +0200
committerRory& <root@rory.gay>2025-10-19 08:59:32 +0200
commit20177860e0a99ca0e5865393cac53f2d5a5f5d6a (patch)
treeac1dba2dcedf06b7da4b4634cafc5f99938510d6 /src
parentAlways mutate opts, not message (diff)
downloadserver-ts-20177860e0a99ca0e5865393cac53f2d5a5f5d6a.tar.xz
More env settings to tune down log noise
Diffstat (limited to 'src')
-rw-r--r--src/api/routes/users/@me/settings-proto/1.ts9
-rw-r--r--src/api/routes/users/@me/settings-proto/2.ts9
-rw-r--r--src/gateway/opcodes/Identify.ts2
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) : ""); }