From 51c638c479325f066a794adfd02bcec55007b631 Mon Sep 17 00:00:00 2001 From: Dominic Maas Date: Fri, 16 Sep 2022 07:44:40 +1200 Subject: [PATCH] This should correct unix line endings (#285) --- src/api/Log.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/Log.cs b/src/api/Log.cs index 104c9d0d..807c9d86 100644 --- a/src/api/Log.cs +++ b/src/api/Log.cs @@ -11,7 +11,7 @@ public class Log public bool LogDebug { get; set; } public readonly string CurrentLogFile; - private const string Layout = "[{0}] [{1}] {2}\r\n"; + private const string Layout = "[{0}] [{1}] {2}"; private const int KeepLogFiles = 5; private readonly FileStream _fileStream; @@ -38,10 +38,12 @@ public Log(string localApplicationData) { _fileStream.Dispose(); } - + private void Write(string message, string level) { message = string.Format(Layout, DateTime.Now.ToString("HH:mm:ss.ffff"), level, message); + message += Environment.NewLine; + byte[] info = new UTF8Encoding(true).GetBytes(message); _fileStream.Write(info, 0, info.Length); _fileStream.Flush();