From 10bc4d20a2b21902bc99332516d424ff2a3a7eca Mon Sep 17 00:00:00 2001 From: "Hatter Jiang@Pixelbook" Date: Fri, 14 May 2021 01:11:51 +0800 Subject: [PATCH] feat: logging --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index 4428189..1a4e1ed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,8 +94,10 @@ fn client_exit(room_map: &RoomMap, room_id: &Option, 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); } }