From 886e42fb19b5d69a6a256e20bd1b948124f790a3 Mon Sep 17 00:00:00 2001 From: Thog Date: Thu, 30 Apr 2020 14:07:41 +0200 Subject: 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. --- Ryujinx.Common/Logging/Targets/JsonLogTarget.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Ryujinx.Common/Logging') 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() -- cgit v1.2.3