From bd55bed2a6989919e724b3fc11fa5d8252ecb926 Mon Sep 17 00:00:00 2001 From: Kazuhiro Fujieda Date: Thu, 25 Oct 2018 23:24:56 +0900 Subject: [PATCH] =?utf8?q?debug.log=E3=81=AE=E7=AB=B6=E5=90=88=E7=8A=B6?= =?utf8?q?=E6=85=8B=E3=82=92=E8=A7=A3=E6=B6=88=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KancolleSniffer/Net/HttpProxy.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/KancolleSniffer/Net/HttpProxy.cs b/KancolleSniffer/Net/HttpProxy.cs index b04f588..beee8f7 100644 --- a/KancolleSniffer/Net/HttpProxy.cs +++ b/KancolleSniffer/Net/HttpProxy.cs @@ -36,7 +36,9 @@ namespace KancolleSniffer.Net public static event Action AfterSessionComplete; private TcpListener _listener; - +#if DEBUG + private static readonly object SyncObj = new object(); +#endif public static void Startup(int port, bool dummy0, bool dummy1) { LocalPort = port; @@ -137,7 +139,8 @@ namespace KancolleSniffer.Net #if DEBUG catch (Exception e) { - File.AppendAllText("debug.log", $"[{DateTime.Now:g}] " + e + "\r\n"); + lock (SyncObj) + File.AppendAllText("debug.log", $"[{DateTime.Now:g}] " + e + "\r\n"); } #else // ReSharper disable once EmptyGeneralCatchClause catch -- 2.11.0