aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2024-04-14 23:19:38 +0200
committerBond_009 <bond.009@outlook.com>2024-04-14 23:19:38 +0200
commite9ae2d6a1e8eba531d9597a886cf3c202ae6bcd2 (patch)
tree36b1b631473cee61092daae6a2559125f47c1a10
parent6fb6b5f1766a1f37a61b9faaa40209bab995bf30 (diff)
Write JSON directly to logfile
Can't be worse than serializing to a string, concatenating and converting to utf8, right?
-rw-r--r--MediaBrowser.MediaEncoding/Transcoding/TranscodeManager.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/MediaBrowser.MediaEncoding/Transcoding/TranscodeManager.cs b/MediaBrowser.MediaEncoding/Transcoding/TranscodeManager.cs
index a07a0f41b..ea5dbf7f7 100644
--- a/MediaBrowser.MediaEncoding/Transcoding/TranscodeManager.cs
+++ b/MediaBrowser.MediaEncoding/Transcoding/TranscodeManager.cs
@@ -492,12 +492,11 @@ public sealed class TranscodeManager : ITranscodeManager, IDisposable
IODefaults.FileStreamBufferSize,
FileOptions.Asynchronous);
- var commandLineLogMessage = process.StartInfo.FileName + " " + process.StartInfo.Arguments;
+ await JsonSerializer.SerializeAsync(logStream, state.MediaSource, cancellationToken: cancellationTokenSource.Token).ConfigureAwait(false);
var commandLineLogMessageBytes = Encoding.UTF8.GetBytes(
- JsonSerializer.Serialize(state.MediaSource)
+ Environment.NewLine
+ Environment.NewLine
- + Environment.NewLine
- + commandLineLogMessage
+ + process.StartInfo.FileName + " " + process.StartInfo.Arguments
+ Environment.NewLine
+ Environment.NewLine);