add stub loglevel

This commit is contained in:
emmaus 2018-04-14 15:24:41 +00:00
parent 494e6dfa1e
commit c1476e18a9
3 changed files with 31 additions and 6 deletions

View file

@ -17,6 +17,7 @@ namespace Ryujinx.Core
public static bool LoggingEnableError { get; private set; }
public static bool LoggingEnableFatal { get; private set; }
public static bool LoggingEnableIpc { get; private set; }
public static bool LoggingEnableStub { get; private set; }
public static bool LoggingEnableLogFile { get; private set; }
public static bool LoggingEnableFilter { get; private set; }
public static bool[] LoggingFilteredClasses { get; private set; }
@ -37,6 +38,7 @@ namespace Ryujinx.Core
LoggingEnableError = Convert.ToBoolean(Parser.Value("Logging_Enable_Error"));
LoggingEnableFatal = Convert.ToBoolean(Parser.Value("Logging_Enable_Fatal"));
LoggingEnableIpc = Convert.ToBoolean(Parser.Value("Logging_Enable_Ipc"));
LoggingEnableStub = Convert.ToBoolean(Parser.Value("Logging_Enable_Stub"));
LoggingEnableLogFile = Convert.ToBoolean(Parser.Value("Logging_Enable_LogFile"));
LoggingEnableFilter = Convert.ToBoolean(Parser.Value("Logging_Enable_Filter"));
LoggingFilteredClasses = new bool[(int)LogClass.Count];

View file

@ -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)

View file

@ -19,6 +19,9 @@ Logging_Enable_Error = true
#Enable print fatal logs
Logging_Enable_Fatal = true
#Enable print stubbed calls logs
Logging_Enable_Stub = false
#Enable print Ipc logs
Logging_Enable_Ipc = false