fix(scripting): companion sink falls back to ScriptId for the main-log mirror (T3 review)

This commit is contained in:
Joseph Doherty
2026-06-10 12:08:29 -04:00
parent bd2dd05a0c
commit 788bb68d1d
2 changed files with 32 additions and 1 deletions
@@ -47,7 +47,8 @@ public sealed class ScriptLogCompanionSink : ILogEventSink
if (logEvent.Level < _minMirrorLevel) return;
var scriptName = "unknown";
if (logEvent.Properties.TryGetValue(ScriptLoggerFactory.ScriptNameProperty, out var prop)
if ((logEvent.Properties.TryGetValue(ScriptLoggerFactory.ScriptNameProperty, out var prop)
|| logEvent.Properties.TryGetValue(ScriptLoggerFactory.ScriptIdProperty, out prop))
&& prop is ScalarValue sv && sv.Value is string s)
{
scriptName = s;