aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Common/Logging
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Common/Logging')
-rw-r--r--Ryujinx.Common/Logging/Logger.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/Ryujinx.Common/Logging/Logger.cs b/Ryujinx.Common/Logging/Logger.cs
index c1abdba9..4d48dd48 100644
--- a/Ryujinx.Common/Logging/Logger.cs
+++ b/Ryujinx.Common/Logging/Logger.cs
@@ -1,3 +1,4 @@
+using Ryujinx.Common.SystemInterop;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -14,6 +15,8 @@ namespace Ryujinx.Common.Logging
private static readonly List<ILogTarget> m_LogTargets;
+ private static readonly StdErrAdapter _stdErrAdapter;
+
public static event EventHandler<LogEventArgs> Updated;
public readonly struct Log
@@ -77,7 +80,13 @@ namespace Ryujinx.Common.Logging
{
Updated?.Invoke(null, new LogEventArgs(Level, m_Time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, caller, "Stubbed. " + message), data));
}
- }
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public void PrintRawMsg(string message)
+ {
+ Updated?.Invoke(null, new LogEventArgs(Level, m_Time.Elapsed, Thread.CurrentThread.Name, message));
+ }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static string FormatMessage(LogClass Class, string Caller, string Message) => $"{Class} {Caller}: {Message}";
@@ -119,6 +128,8 @@ namespace Ryujinx.Common.Logging
Warning = new Log(LogLevel.Warning);
Info = new Log(LogLevel.Info);
Trace = new Log(LogLevel.Trace);
+
+ _stdErrAdapter = new StdErrAdapter();
}
public static void RestartTime()
@@ -164,6 +175,8 @@ namespace Ryujinx.Common.Logging
{
Updated = null;
+ _stdErrAdapter.Dispose();
+
foreach (var target in m_LogTargets)
{
target.Dispose();