From c7d9ee204a2e0024aadcdfd476bd6de373f973fb Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 5 Aug 2022 14:32:21 -0700 Subject: [PATCH] the --- QSB/Utility/DebugLog.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/QSB/Utility/DebugLog.cs b/QSB/Utility/DebugLog.cs index 2c5351aa..9f19974e 100644 --- a/QSB/Utility/DebugLog.cs +++ b/QSB/Utility/DebugLog.cs @@ -1,9 +1,7 @@ using OWML.Common; using OWML.Logging; -using QSB.WorldSync; using System.Diagnostics; using System.Linq; -using UnityEngine; namespace QSB.Utility; @@ -19,7 +17,7 @@ public static class DebugLog message = $"[{ProcessInstanceId}] " + message; } - QSBCore.Helper.Console.WriteLine(message, type, GetCallingType(new StackTrace())); + QSBCore.Helper.Console.WriteLine(message, type, GetCallingType()); } public static void ToHud(string message) @@ -44,7 +42,7 @@ public static class DebugLog if (QSBCore.Helper == null) { // yes i know this is only meant for OWML, but it's useful as a backup - ModConsole.OwmlConsole.WriteLine(message, type, GetCallingType(new StackTrace())); + ModConsole.OwmlConsole.WriteLine(message, type, GetCallingType()); return; } @@ -54,8 +52,9 @@ public static class DebugLog } } - private static string GetCallingType(StackTrace frame) => - frame.GetFrames()! + private static string GetCallingType() => + new StackTrace(2) // skip this function and calling function + .GetFrames()! .Select(x => x.GetMethod().DeclaringType!.Name) .First(x => x != nameof(DebugLog)); }