From b334aab4354e317fb2ef3a2e2f34739249a2d116 Mon Sep 17 00:00:00 2001 From: emmauss Date: Tue, 17 Apr 2018 03:24:42 +0300 Subject: Add special log for stubs (#81) * add stub loglevel * add log for stubbed methods --- Ryujinx.Core/Logging.cs | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'Ryujinx.Core/Logging.cs') diff --git a/Ryujinx.Core/Logging.cs b/Ryujinx.Core/Logging.cs index 1767e1a0..f650960e 100644 --- a/Ryujinx.Core/Logging.cs +++ b/Ryujinx.Core/Logging.cs @@ -20,6 +20,7 @@ namespace Ryujinx.Core private static bool EnableWarn = Config.LoggingEnableWarn; private static bool EnableError = Config.LoggingEnableError; private static bool EnableFatal = Config.LoggingEnableFatal; + private static bool EnableStub = Config.LoggingEnableIpc; private static bool EnableIpc = Config.LoggingEnableIpc; private static bool EnableFilter = Config.LoggingEnableFilter; private static bool EnableLogFile = Config.LoggingEnableLogFile; @@ -27,12 +28,13 @@ namespace Ryujinx.Core private enum LogLevel { - Debug = 1, - Error = 2, - Fatal = 3, - Info = 4, - Trace = 5, - Warn = 6 + Debug, + Error, + Fatal, + Info, + Stub, + Trace, + Warn } static Logging() @@ -68,6 +70,9 @@ namespace Ryujinx.Core case LogLevel.Info: consoleColor = ConsoleColor.White; break; + case LogLevel.Stub: + consoleColor = ConsoleColor.DarkYellow; + break; case LogLevel.Trace: consoleColor = ConsoleColor.DarkGray; break; @@ -129,6 +134,21 @@ namespace Ryujinx.Core } } + public static void Stub(LogClass LogClass, string Message, [CallerMemberName] string CallingMember = "") + { + if (EnableStub) + { + LogMessage(new LogEntry + { + CallingMember = CallingMember, + LogLevel = LogLevel.Stub, + LogClass = LogClass, + Message = Message, + ExecutionTime = GetExecutionTime() + }); + } + } + public static void Debug(LogClass LogClass,string Message, [CallerMemberName] string CallingMember = "") { if (EnableDebug) -- cgit v1.2.3