Browse Source

bin/ircd: print the privmsg on send and receive

ghassmo 3 năm trước cách đây
mục cha
commit
4a47efb330
2 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 2 2
      bin/ircd/src/irc/client.rs
  2. 1 1
      src/net/message_subscriber.rs

+ 2 - 2
bin/ircd/src/irc/client.rs

@@ -83,7 +83,7 @@ impl<C: AsyncRead + AsyncWrite + Send + Unpin + 'static> IrcClient<C> {
     }
 
     pub async fn process_msg(&mut self, msg: &Privmsg) -> Result<()> {
-        info!("[P2P] Received: {}", msg.to_string().trim());
+        info!("[P2P] Received: {:?}", msg);
 
         let mut msg = msg.clone();
         let mut contact = String::new();
@@ -484,7 +484,7 @@ impl<C: AsyncRead + AsyncWrite + Send + Unpin + 'static> IrcClient<C> {
             .notify_with_exclude(privmsg.clone(), &[self.subscription.get_id()])
             .await;
 
-        info!("[P2P] Broadcast: {:?}", privmsg.to_string().trim());
+        info!("[P2P] Broadcast: {:?}", privmsg);
         self.p2p.broadcast(privmsg).await?;
 
         Ok(())

+ 1 - 1
src/net/message_subscriber.rs

@@ -3,7 +3,7 @@ use std::{any::Any, io, io::Cursor, sync::Arc};
 
 use async_trait::async_trait;
 use fxhash::FxHashMap;
-use log::{debug, error, warn};
+use log::{debug, warn};
 use rand::Rng;
 
 use crate::{