From 6bf77aa12e4c9f87805e0402468041136a7260c9 Mon Sep 17 00:00:00 2001 From: AlanMoonbase Date: Tue, 15 Jul 2025 14:15:31 -0700 Subject: [PATCH] Add `enableDebugLogs` Config Property --- qtc-net-client-2/ClientModel/Config.cs | 3 +++ qtc-net-client-2/Forms/Main.cs | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qtc-net-client-2/ClientModel/Config.cs b/qtc-net-client-2/ClientModel/Config.cs index 0ec71f8..c0bb70a 100644 --- a/qtc-net-client-2/ClientModel/Config.cs +++ b/qtc-net-client-2/ClientModel/Config.cs @@ -15,6 +15,9 @@ namespace qtc_net_client_2.ClientModel [JsonPropertyName("minimizeToTray")] [JsonRequired] public bool MinimizeToTray { get; set; } = true; + [JsonPropertyName("enableDebugLogs")] + [JsonRequired] + public bool EnableDebugLogs { get; set; } = false; [JsonPropertyName("serverUrl")] [JsonRequired] diff --git a/qtc-net-client-2/Forms/Main.cs b/qtc-net-client-2/Forms/Main.cs index 1f2623a..4c2102d 100644 --- a/qtc-net-client-2/Forms/Main.cs +++ b/qtc-net-client-2/Forms/Main.cs @@ -657,7 +657,7 @@ namespace qtc_net_client_2 UserDirectory.Add(user); } - if (System.Diagnostics.Debugger.IsAttached) + if (System.Diagnostics.Debugger.IsAttached || _config.EnableDebugLogs) LoggingService.LogModel(userList.Data); } }); @@ -681,7 +681,7 @@ namespace qtc_net_client_2 lbRooms.Items.Add(room.Name); } RoomList = roomsRes.Data; - if (System.Diagnostics.Debugger.IsAttached) + if (System.Diagnostics.Debugger.IsAttached || _config.EnableDebugLogs) LoggingService.LogModel(roomsRes.Data); } @@ -765,7 +765,7 @@ namespace qtc_net_client_2 } } - if (System.Diagnostics.Debugger.IsAttached) + if (System.Diagnostics.Debugger.IsAttached || _config.EnableDebugLogs) LoggingService.LogModel(contactsRes.Data); } });