From 0beaf606dadf9696d5b65cc511644a01a42e6826 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Wed, 10 Apr 2019 19:12:55 -0500 Subject: [PATCH] Tweaked debug info code --- IPA.Loader/Logging/StandardLogger.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/IPA.Loader/Logging/StandardLogger.cs b/IPA.Loader/Logging/StandardLogger.cs index 94ef2968..a046a787 100644 --- a/IPA.Loader/Logging/StandardLogger.cs +++ b/IPA.Loader/Logging/StandardLogger.cs @@ -208,19 +208,21 @@ namespace IPA.Logging { // add source to message var stackFrame = new StackTrace(true).GetFrame(1); - var method = stackFrame.GetMethod(); var lineNo = stackFrame.GetFileLineNumber(); - var fileName = stackFrame.GetFileName(); - var paramString = string.Join(", ", method.GetParameters().Select(p => p.ParameterType.FullName)); - message = lineNo == 0 ? // no symbols - $"{{{method.DeclaringType?.FullName}::{method.Name}({paramString})}} {message}" : - $"{{{fileName}:{lineNo}}} {message}"; + if (lineNo == 0) + { // no debug info + var method = stackFrame.GetMethod(); + var paramString = string.Join(", ", method.GetParameters().Select(p => p.ParameterType.FullName)); + + message = $"{{{method.DeclaringType?.FullName}::{method.Name}({paramString})}} {message}"; + } + else + message = $"{{{stackFrame.GetFileName()}:{lineNo}}} {message}"; - base.Debug(message); } - else - base.Debug(message); + + base.Debug(message); } private struct LogMessage