aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Common/Logging
diff options
context:
space:
mode:
authorAlex Barney <thealexbarney@gmail.com>2019-06-15 20:31:18 -0500
committerAc_K <Acoustik666@gmail.com>2019-06-16 03:31:18 +0200
commit350a3667f755ffa80737995c953b31102f7bc523 (patch)
treeb106b45d8d95b77667ac03186817bf11d61c52a5 /Ryujinx.Common/Logging
parent5c1bc524092b3c5d867ce6204ac9db27b7359d3f (diff)
Implement OutputAccessLogToSdCard and expose an FS access log option (#700)
* Add OutputAccessLogToSdCard * Add config options for the FS access log
Diffstat (limited to 'Ryujinx.Common/Logging')
-rw-r--r--Ryujinx.Common/Logging/LogLevel.cs4
-rw-r--r--Ryujinx.Common/Logging/Logger.cs20
2 files changed, 19 insertions, 5 deletions
diff --git a/Ryujinx.Common/Logging/LogLevel.cs b/Ryujinx.Common/Logging/LogLevel.cs
index ba3fa99f..5f80714f 100644
--- a/Ryujinx.Common/Logging/LogLevel.cs
+++ b/Ryujinx.Common/Logging/LogLevel.cs
@@ -6,6 +6,8 @@ namespace Ryujinx.Common.Logging
Stub,
Info,
Warning,
- Error
+ Error,
+ Guest,
+ AccessLog
}
}
diff --git a/Ryujinx.Common/Logging/Logger.cs b/Ryujinx.Common/Logging/Logger.cs
index 88ebe473..95b67c8e 100644
--- a/Ryujinx.Common/Logging/Logger.cs
+++ b/Ryujinx.Common/Logging/Logger.cs
@@ -22,10 +22,12 @@ namespace Ryujinx.Common.Logging
m_EnabledLevels = new bool[Enum.GetNames(typeof(LogLevel)).Length];
m_EnabledClasses = new bool[Enum.GetNames(typeof(LogClass)).Length];
- m_EnabledLevels[(int)LogLevel.Stub] = true;
- m_EnabledLevels[(int)LogLevel.Info] = true;
- m_EnabledLevels[(int)LogLevel.Warning] = true;
- m_EnabledLevels[(int)LogLevel.Error] = true;
+ m_EnabledLevels[(int)LogLevel.Stub] = true;
+ m_EnabledLevels[(int)LogLevel.Info] = true;
+ m_EnabledLevels[(int)LogLevel.Warning] = true;
+ m_EnabledLevels[(int)LogLevel.Error] = true;
+ m_EnabledLevels[(int)LogLevel.Guest] = true;
+ m_EnabledLevels[(int)LogLevel.AccessLog] = true;
for (int index = 0; index < m_EnabledClasses.Length; index++)
{
@@ -101,6 +103,16 @@ namespace Ryujinx.Common.Logging
Print(LogLevel.Stub, logClass, GetFormattedMessage(logClass, "Stubbed. " + message, caller), obj);
}
+ public static void PrintGuest(LogClass logClass, string message, [CallerMemberName] string caller = "")
+ {
+ Print(LogLevel.Guest, logClass, GetFormattedMessage(logClass, message, caller));
+ }
+
+ public static void PrintAccessLog(LogClass logClass, string message)
+ {
+ Print(LogLevel.AccessLog, logClass, message);
+ }
+
private static void Print(LogLevel logLevel, LogClass logClass, string message)
{
if (m_EnabledLevels[(int)logLevel] && m_EnabledClasses[(int)logClass])