[Logger] Add print with stacktrace method (#5129)

* Add print with stacktrace method

* Adjust logging namespaces

* Add static keyword to DynamicObjectFormatter
This commit is contained in:
TSRBerry 2023-06-01 15:47:53 +02:00 committed by GitHub
parent 12c62fdbc2
commit f4539c49d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 44 additions and 19 deletions

View file

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