From f4539c49d8def4c6086a61fe4bd9ed9665fac4b1 Mon Sep 17 00:00:00 2001 From: TSRBerry <20988865+TSRBerry@users.noreply.github.com> Date: Thu, 1 Jun 2023 15:47:53 +0200 Subject: [Logger] Add print with stacktrace method (#5129) * Add print with stacktrace method * Adjust logging namespaces * Add static keyword to DynamicObjectFormatter --- .../Logging/Formatters/DefaultLogFormatter.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs') diff --git a/src/Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs b/src/Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs index 28a7d546..3769b03a 100644 --- a/src/Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs +++ b/src/Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs @@ -1,6 +1,7 @@ -using System.Text; +using System.Diagnostics; +using System.Text; -namespace Ryujinx.Common.Logging +namespace Ryujinx.Common.Logging.Formatters { internal class DefaultLogFormatter : ILogFormatter { @@ -27,6 +28,14 @@ namespace Ryujinx.Common.Logging if (args.Data is not null) { + if (args.Data is StackTrace trace) + { + sb.Append('\n'); + sb.Append(trace); + + return sb.ToString(); + } + sb.Append(' '); DynamicObjectFormatter.Format(sb, args.Data); } @@ -39,4 +48,4 @@ namespace Ryujinx.Common.Logging } } } -} +} \ No newline at end of file -- cgit v1.2.3