From da0228b19fc6dccd6680933a3844896f0638b17c Mon Sep 17 00:00:00 2001 From: KernelDeimos <7225168+KernelDeimos@users.noreply.github.com> Date: Thu, 16 Oct 2025 15:55:11 -0400 Subject: [PATCH] devex: hide system actor from extension log fields --- src/backend/src/modules/core/lib/log.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/backend/src/modules/core/lib/log.js b/src/backend/src/modules/core/lib/log.js index 8c1d6e72d..17e3f2174 100644 --- a/src/backend/src/modules/core/lib/log.js +++ b/src/backend/src/modules/core/lib/log.js @@ -74,6 +74,16 @@ const stringify_log_entry = ({ prefix, log_lvl, crumbs, message, fields, objects m += ` ${message} `; lf(); for ( const k in fields ) { + // Extensions always have the system actor in context which makes logs + // too verbose. To combat this, we disable logging the 'actor' field + // when the actor's username is 'system' and the `crumbs` include a + // string that starts with 'extension'. + if ( k === 'actor' && crumbs.some(crumb => crumb.startsWith('extension/')) ) { + if ( typeof fields[k] === 'object' && fields[k]?.username === 'system' ) { + continue; + } + } + if ( k === 'timestamp' ) continue; let v; try { v = colorize(JSON.stringify(fields[k]));