diff options
| author | Ac_K <Acoustik666@gmail.com> | 2023-01-12 07:42:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-12 07:42:05 +0100 |
| commit | fd36c8deca889680f4cc6150befd581559089318 (patch) | |
| tree | 1ad354cea0045e7ad65dde7154bbf91b3d0ca0f0 /Ryujinx.Horizon/LogManager/Types | |
| parent | 70638340b30d0e9769224df770aa8817b5598793 (diff) | |
lm: Handle Tail flag in LogPacket (#4274)
* lm: Handle TailFlag in LogPacket
* Addresses feedback
Diffstat (limited to 'Ryujinx.Horizon/LogManager/Types')
| -rw-r--r-- | Ryujinx.Horizon/LogManager/Types/LogPacket.cs | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/Ryujinx.Horizon/LogManager/Types/LogPacket.cs b/Ryujinx.Horizon/LogManager/Types/LogPacket.cs new file mode 100644 index 00000000..dbff5e3e --- /dev/null +++ b/Ryujinx.Horizon/LogManager/Types/LogPacket.cs @@ -0,0 +1,72 @@ +using Ryujinx.Horizon.Sdk.Diag; +using System.Text; + +namespace Ryujinx.Horizon.LogManager.Types +{ + struct LogPacket + { + public string Message; + public int Line; + public string Filename; + public string Function; + public string Module; + public string Thread; + public long DropCount; + public long Time; + public string ProgramName; + public LogSeverity Severity; + + public override string ToString() + { + StringBuilder builder = new(); + builder.AppendLine($"Guest Log:\n Log level: {Severity}"); + + if (Time > 0) + { + builder.AppendLine($" Time: {Time}s"); + } + + if (DropCount > 0) + { + builder.AppendLine($" DropCount: {DropCount}"); + } + + if (!string.IsNullOrEmpty(ProgramName)) + { + builder.AppendLine($" ProgramName: {ProgramName}"); + } + + if (!string.IsNullOrEmpty(Module)) + { + builder.AppendLine($" Module: {Module}"); + } + + if (!string.IsNullOrEmpty(Thread)) + { + builder.AppendLine($" Thread: {Thread}"); + } + + if (!string.IsNullOrEmpty(Filename)) + { + builder.AppendLine($" Filename: {Filename}"); + } + + if (Line > 0) + { + builder.AppendLine($" Line: {Line}"); + } + + if (!string.IsNullOrEmpty(Function)) + { + builder.AppendLine($" Function: {Function}"); + } + + if (!string.IsNullOrEmpty(Message)) + { + builder.AppendLine($" Message: {Message}"); + } + + return builder.ToString(); + } + } +}
\ No newline at end of file |
