diff options
Diffstat (limited to 'src/Ryujinx.Common/Logging/Logger.cs')
-rw-r--r-- | src/Ryujinx.Common/Logging/Logger.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Ryujinx.Common/Logging/Logger.cs b/src/Ryujinx.Common/Logging/Logger.cs index 4d48dd48..25f9c5ee 100644 --- a/src/Ryujinx.Common/Logging/Logger.cs +++ b/src/Ryujinx.Common/Logging/Logger.cs @@ -1,3 +1,4 @@ +using Ryujinx.Common.Logging.Targets; using Ryujinx.Common.SystemInterop; using System; using System.Collections.Generic; @@ -55,6 +56,16 @@ namespace Ryujinx.Common.Logging } } + [StackTraceHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void PrintStack(LogClass logClass, string message, [CallerMemberName] string caller = "") + { + if (m_EnabledClasses[(int)logClass]) + { + Updated?.Invoke(null, new LogEventArgs(Level, m_Time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, caller, message), new StackTrace(true))); + } + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void PrintStub(LogClass logClass, string message = "", [CallerMemberName] string caller = "") { @@ -122,7 +133,7 @@ namespace Ryujinx.Common.Logging AsyncLogTargetOverflowAction.Discard)); Notice = new Log(LogLevel.Notice); - + // Enable important log levels before configuration is loaded Error = new Log(LogLevel.Error); Warning = new Log(LogLevel.Warning); @@ -221,4 +232,4 @@ namespace Ryujinx.Common.Logging m_EnabledClasses[(int)logClass] = enabled; } } -} +}
\ No newline at end of file |