Skip to content

Commit

Permalink
debug log for outbound packets
Browse files Browse the repository at this point in the history
  • Loading branch information
chatasma committed Jul 13, 2024
1 parent 248c795 commit 668b64a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/socket/server/server_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ impl ServerContext {
pub async fn call<T: Serialize>(&mut self, event_type: &EventType, data: T) {
let packet = Packet { event: event_type.clone(), data };
let body = serde_json::to_string(&packet).unwrap();
debug!("Sending {} to {}", &body, &self.id);
let binary = Message::Binary(deflate_string(body.as_bytes()).unwrap());
let _ = self.stream.send(binary).await;
}
Expand Down

0 comments on commit 668b64a

Please sign in to comment.