aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Common/Logging
diff options
context:
space:
mode:
authorThog <me@thog.eu>2020-04-30 14:07:41 +0200
committerGitHub <noreply@github.com>2020-04-30 14:07:41 +0200
commit886e42fb19b5d69a6a256e20bd1b948124f790a3 (patch)
tree8648c0a8b3cb82032e9cc9adae411cc8d1dbc8d3 /Ryujinx.Common/Logging
parent7ab3fccd4d13bf3ed07a7fa207cfee61b43c56f3 (diff)
Use the official JSON parser (#1151)
This remove Utf8son and JsonPrettyPrinter dependencies. NOTE: the standard JSON parser doesn't support configurable indentation, as a result, all the pretty printed JSON are indented with 2 spaces.
Diffstat (limited to 'Ryujinx.Common/Logging')
-rw-r--r--Ryujinx.Common/Logging/Targets/JsonLogTarget.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/Ryujinx.Common/Logging/Targets/JsonLogTarget.cs b/Ryujinx.Common/Logging/Targets/JsonLogTarget.cs
index 3729b18d..95f96576 100644
--- a/Ryujinx.Common/Logging/Targets/JsonLogTarget.cs
+++ b/Ryujinx.Common/Logging/Targets/JsonLogTarget.cs
@@ -1,6 +1,5 @@
-using System;
-using System.IO;
-using Utf8Json;
+using System.IO;
+using System.Text.Json;
namespace Ryujinx.Common.Logging
{
@@ -26,7 +25,12 @@ namespace Ryujinx.Common.Logging
public void Log(object sender, LogEventArgs e)
{
- JsonSerializer.Serialize(_stream, e);
+ string text = JsonSerializer.Serialize(e);
+
+ using (BinaryWriter writer = new BinaryWriter(_stream))
+ {
+ writer.Write(text);
+ }
}
public void Dispose()