mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-26 13:05:21 +00:00
Add comprehensive logging system for debugging
- Create LoggingService that writes to Documents/Logs directory - Log to both console and file with timestamps - Replace debug print statements with bitchatLog() - Add log file location display in AppInfoView - Enable opening log file in Finder on macOS - Track room member operations and view state - Persist logs for debugging room member display issues
This commit is contained in:
@@ -601,9 +601,9 @@ struct ContentView: View {
|
||||
if let currentRoom = viewModel.currentRoom,
|
||||
let roomMemberIDs = viewModel.roomMembers[currentRoom] {
|
||||
// Show only peers who have sent messages to this room (including self)
|
||||
print("[DEBUG-VIEW] Room \(currentRoom) has members: \(roomMemberIDs)")
|
||||
print("[DEBUG-VIEW] Connected peers: \(viewModel.connectedPeers)")
|
||||
print("[DEBUG-VIEW] My peer ID: \(myPeerID)")
|
||||
bitchatLog("Room \(currentRoom) has members: \(roomMemberIDs)", category: "view")
|
||||
bitchatLog("Connected peers: \(viewModel.connectedPeers)", category: "view")
|
||||
bitchatLog("My peer ID: \(myPeerID)", category: "view")
|
||||
|
||||
// Start with room members who are also connected
|
||||
var memberPeers = viewModel.connectedPeers.filter { roomMemberIDs.contains($0) }
|
||||
@@ -613,7 +613,7 @@ struct ContentView: View {
|
||||
memberPeers.append(myPeerID)
|
||||
}
|
||||
|
||||
print("[DEBUG-VIEW] Peers to show in room: \(memberPeers)")
|
||||
bitchatLog("Peers to show in room: \(memberPeers)", category: "view")
|
||||
return memberPeers
|
||||
} else {
|
||||
// Show all connected peers in main chat
|
||||
|
||||
Reference in New Issue
Block a user