From 8911d4ebc2e2134661360de3c2e0e26b6e202c0c Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Tue, 12 Sep 2023 18:33:41 -0700 Subject: [PATCH] Re-add SourceContext property check Technically an API breakage, some plugins are passing this for logging. Slated for removal in API 9, however. --- Dalamud/Interface/Internal/Windows/ConsoleWindow.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs b/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs index 3303a2280..0febc0fc4 100644 --- a/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs +++ b/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs @@ -504,14 +504,16 @@ internal class ConsoleWindow : Window, IDisposable HasException = logEvent.Exception != null, }; + // TODO (v9): Remove SourceContext property check. if (logEvent.Properties.ContainsKey("Dalamud.ModuleName")) { entry.Source = "DalamudInternal"; } - else if (logEvent.Properties.TryGetValue("Dalamud.PluginName", out var sourceProp) && - sourceProp is ScalarValue { Value: string value }) + else if ((logEvent.Properties.TryGetValue("Dalamud.PluginName", out var sourceProp) || + logEvent.Properties.TryGetValue("SourceContext", out sourceProp)) && + sourceProp is ScalarValue { Value: string sourceValue }) { - entry.Source = value; + entry.Source = sourceValue; } this.logText.Add(entry);