remove some debug logs

This commit is contained in:
Ferdinand Schober
2024-09-24 19:22:17 +02:00
parent ed7771691f
commit 859bec5df8
5 changed files with 9 additions and 17 deletions

View File

@@ -167,7 +167,6 @@ impl InputCapture {
/// release mouse /// release mouse
pub async fn release(&mut self) -> Result<(), CaptureError> { pub async fn release(&mut self) -> Result<(), CaptureError> {
log::info!("RELEASE CAPTURE");
self.pressed_keys.clear(); self.pressed_keys.clear();
self.capture.release().await self.capture.release().await
} }

View File

@@ -130,7 +130,10 @@ async fn do_capture(
match event { match event {
// connection acknowlegded => set state to Sending // connection acknowlegded => set state to Sending
ProtoEvent::Ack(_) => state = State::Sending, ProtoEvent::Ack(_) => {
log::info!("client {handle} acknowledged the connection!");
state = State::Sending;
}
// client disconnected // client disconnected
ProtoEvent::Leave(_) => release_capture(&mut capture, server).await?, ProtoEvent::Leave(_) => release_capture(&mut capture, server).await?,
_ => {} _ => {}
@@ -207,6 +210,7 @@ async fn handle_capture_event(
if event == CaptureEvent::Begin && Some(handle) != server.get_active() { if event == CaptureEvent::Begin && Some(handle) != server.get_active() {
*state = State::WaitingForAck; *state = State::WaitingForAck;
server.set_active(Some(handle)); server.set_active(Some(handle));
log::info!("entering client {handle} ...");
spawn_hook_command(server, handle); spawn_hook_command(server, handle);
} }
@@ -219,11 +223,9 @@ async fn handle_capture_event(
}, },
}; };
log::info!("CAPTURE {event} >=>=>=>=>=> {handle}");
if let Err(e) = conn.send(event, handle).await { if let Err(e) = conn.send(event, handle).await {
// const DUR: Duration = Duration::from_millis(500); const DUR: Duration = Duration::from_millis(500);
log::warn!("releasing capture: {e}"); debounce!(PREV_LOG, DUR, log::warn!("releasing capture: {e}"));
// debounce!(PREV_LOG, DUR, log::warn!("releasing capture: {e}"));
capture.release().await?; capture.release().await?;
} }
Ok(()) Ok(())

View File

@@ -96,7 +96,6 @@ impl LanMouseConnection {
) -> Result<(), LanMouseConnectionError> { ) -> Result<(), LanMouseConnectionError> {
let (buf, len): ([u8; MAX_EVENT_SIZE], usize) = event.into(); let (buf, len): ([u8; MAX_EVENT_SIZE], usize) = event.into();
let buf = &buf[..len]; let buf = &buf[..len];
log::info!("{event} =>=>=>=>=>=> {handle}");
if let Some(addr) = self.server.active_addr(handle) { if let Some(addr) = self.server.active_addr(handle) {
let conn = { let conn = {
let conns = self.conns.lock().await; let conns = self.conns.lock().await;

View File

@@ -41,11 +41,7 @@ impl Emulation {
Some(e) => e, Some(e) => e,
None => break, None => break,
}; };
if let ProtoEvent::Ping = event { log::trace!("{event} <-<-<-<-<- {addr}");
log::trace!("{event} <-<-<-<-<- {addr}");
} else {
log::info!("{event} <-<-<-<-<- {addr}");
}
last_response.insert(addr, Instant::now()); last_response.insert(addr, Instant::now());
match event { match event {
ProtoEvent::Enter(_) => { ProtoEvent::Enter(_) => {

View File

@@ -96,11 +96,7 @@ impl LanMouseListener {
} }
pub(crate) async fn reply(&self, addr: SocketAddr, event: ProtoEvent) { pub(crate) async fn reply(&self, addr: SocketAddr, event: ProtoEvent) {
if let ProtoEvent::Pong = event { log::trace!("reply {event} >=>=>=>=>=> {addr}");
log::trace!("reply {event} >=>=>=>=>=> {addr}");
} else {
log::info!("reply {event} >=>=>=>=>=> {addr}");
}
let (buf, len): ([u8; MAX_EVENT_SIZE], usize) = event.into(); let (buf, len): ([u8; MAX_EVENT_SIZE], usize) = event.into();
let conns = self.conns.lock().await; let conns = self.conns.lock().await;
for (a, conn) in conns.iter() { for (a, conn) in conns.iter() {