feat: logging

This commit is contained in:
2021-05-14 01:11:51 +08:00
parent f99a426e26
commit 10bc4d20a2

View File

@@ -94,8 +94,10 @@ fn client_exit(room_map: &RoomMap, room_id: &Option<String>, client_id: &Option<
if let (Some(room_id), Some(client_id)) = (room_id, client_id) {
let mut room_map = room_map.lock().unwrap();
if let Some(client_map) = room_map.get_mut(room_id) {
information!("Client: {} exit from room: {}", client_id, room_id);
client_map.remove(client_id);
if client_map.is_empty() {
information!("Room is empty, close room: {}", room_id);
room_map.remove(room_id);
}
}