From fe126a99d1bbaf1d461e9319c848654d501d4814 Mon Sep 17 00:00:00 2001 From: AcK77 Date: Fri, 9 Feb 2018 20:24:41 +0100 Subject: [PATCH] Logging Improvements2 Little modifications --- Ryujinx/Logging.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Ryujinx/Logging.cs b/Ryujinx/Logging.cs index 101d81974f..e96fd95782 100644 --- a/Ryujinx/Logging.cs +++ b/Ryujinx/Logging.cs @@ -31,6 +31,11 @@ namespace Ryujinx return ExecutionTime.ElapsedMilliseconds.ToString().PadLeft(8, '0') + "ms"; } + private static string WhoCalledMe() + { + return new StackTrace().GetFrame(2).GetMethod().Name; + } + private static void LogFile(string Message) { if (EnableLogFile) @@ -74,7 +79,7 @@ namespace Ryujinx { if (EnableDebug) { - string Text = $"{GetExecutionTime()} | DEBUG > {Message}"; + string Text = $"{GetExecutionTime()} | DEBUG > {WhoCalledMe()} - {Message}"; Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine(Text.PadLeft(Text.Length + 1, ' ')); @@ -88,7 +93,7 @@ namespace Ryujinx { if (EnableWarn) { - string Text = $"{GetExecutionTime()} | WARN > {Message}"; + string Text = $"{GetExecutionTime()} | WARN > {WhoCalledMe()} - {Message}"; Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine(Text.PadLeft(Text.Length + 1, ' ')); @@ -102,7 +107,7 @@ namespace Ryujinx { if (EnableError) { - string Text = $"{GetExecutionTime()} | ERROR > {Message}"; + string Text = $"{GetExecutionTime()} | ERROR > {WhoCalledMe()} - {Message}"; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(Text.PadLeft(Text.Length + 1, ' ')); @@ -116,7 +121,7 @@ namespace Ryujinx { if (EnableFatal) { - string Text = $"{GetExecutionTime()} | FATAL > {Message}"; + string Text = $"{GetExecutionTime()} | FATAL > {WhoCalledMe()} - {Message}"; Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine(Text.PadLeft(Text.Length + 1, ' ')); @@ -125,10 +130,5 @@ namespace Ryujinx LogFile(Text); } } - - private static string WhoCalledMe() - { - return new StackTrace().GetFrame(2).GetMethod().Name; - } } }