aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Common/Logging/Targets/JsonLogTarget.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Common/Logging/Targets/JsonLogTarget.cs')
-rw-r--r--Ryujinx.Common/Logging/Targets/JsonLogTarget.cs12
1 files changed, 4 insertions, 8 deletions
diff --git a/Ryujinx.Common/Logging/Targets/JsonLogTarget.cs b/Ryujinx.Common/Logging/Targets/JsonLogTarget.cs
index 95f96576..06976433 100644
--- a/Ryujinx.Common/Logging/Targets/JsonLogTarget.cs
+++ b/Ryujinx.Common/Logging/Targets/JsonLogTarget.cs
@@ -1,5 +1,5 @@
-using System.IO;
-using System.Text.Json;
+using Ryujinx.Common.Utilities;
+using System.IO;
namespace Ryujinx.Common.Logging
{
@@ -25,12 +25,8 @@ namespace Ryujinx.Common.Logging
public void Log(object sender, LogEventArgs e)
{
- string text = JsonSerializer.Serialize(e);
-
- using (BinaryWriter writer = new BinaryWriter(_stream))
- {
- writer.Write(text);
- }
+ var logEventArgsJson = LogEventArgsJson.FromLogEventArgs(e);
+ JsonHelper.SerializeToStream(_stream, logEventArgsJson, LogEventJsonSerializerContext.Default.LogEventArgsJson);
}
public void Dispose()