Add enableDebugLogs Config Property

This commit is contained in:
Alan Moon 2025-07-15 14:15:31 -07:00
parent f98e5a490c
commit 6bf77aa12e
2 changed files with 6 additions and 3 deletions

View File

@ -15,6 +15,9 @@ namespace qtc_net_client_2.ClientModel
[JsonPropertyName("minimizeToTray")] [JsonPropertyName("minimizeToTray")]
[JsonRequired] [JsonRequired]
public bool MinimizeToTray { get; set; } = true; public bool MinimizeToTray { get; set; } = true;
[JsonPropertyName("enableDebugLogs")]
[JsonRequired]
public bool EnableDebugLogs { get; set; } = false;
[JsonPropertyName("serverUrl")] [JsonPropertyName("serverUrl")]
[JsonRequired] [JsonRequired]

View File

@ -657,7 +657,7 @@ namespace qtc_net_client_2
UserDirectory.Add(user); UserDirectory.Add(user);
} }
if (System.Diagnostics.Debugger.IsAttached) if (System.Diagnostics.Debugger.IsAttached || _config.EnableDebugLogs)
LoggingService.LogModel(userList.Data); LoggingService.LogModel(userList.Data);
} }
}); });
@ -681,7 +681,7 @@ namespace qtc_net_client_2
lbRooms.Items.Add(room.Name); lbRooms.Items.Add(room.Name);
} }
RoomList = roomsRes.Data; RoomList = roomsRes.Data;
if (System.Diagnostics.Debugger.IsAttached) if (System.Diagnostics.Debugger.IsAttached || _config.EnableDebugLogs)
LoggingService.LogModel(roomsRes.Data); 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); LoggingService.LogModel(contactsRes.Data);
} }
}); });