diff options
| author | Thomas Guillemard <thog@protonmail.com> | 2019-06-27 13:11:51 +0200 |
|---|---|---|
| committer | Ac_K <Acoustik666@gmail.com> | 2019-06-27 13:11:51 +0200 |
| commit | db21621bb681ee6d85f81fd04d7ea286b0742ca7 (patch) | |
| tree | 074d7c89032cc7775d2ec04679a3cdc78a9d2735 /Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs | |
| parent | 3db9daa3bda5053fdbda248263f0b8fa46bdba0d (diff) | |
PrntStub: Add a way to print arrays (#711)
* PrntStub: Add a way to print arrays
This commit adds support for printing arrays in stubs (useful for IPC InBuffer/InPointer).
This also add an util to parse an array of structure from a BinaryReader
* Fix missing space
Co-Authored-By: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs')
| -rw-r--r-- | Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs b/Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs index 0c4396e7..c6605e0e 100644 --- a/Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs +++ b/Ryujinx.Common/Logging/Formatters/DefaultLogFormatter.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Text; namespace Ryujinx.Common.Logging @@ -31,7 +32,23 @@ namespace Ryujinx.Common.Logging { sb.Append(prop.Name); sb.Append(": "); - sb.Append(prop.GetValue(args.Data)); + + if (typeof(Array).IsAssignableFrom(prop.PropertyType)) + { + Array enumerable = (Array)prop.GetValue(args.Data); + foreach (var item in enumerable) + { + sb.Append(item.ToString()); + sb.Append(", "); + } + + sb.Remove(sb.Length - 2, 2); + } + else + { + sb.Append(prop.GetValue(args.Data)); + } + sb.Append(" - "); } |
