Skip to content

Commit

Permalink
Quiet plist reading logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jkcoxson committed Jan 22, 2025
1 parent a879088 commit 34aa8f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/devices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::{collections::HashMap, io::Read, net::IpAddr, path::PathBuf, sync::Arc};

use log::{info, trace, warn};
use log::{debug, info, trace, warn};
use tokio::sync::{mpsc::UnboundedSender, Mutex};

use crate::heartbeat;
Expand Down Expand Up @@ -187,13 +187,13 @@ impl SharedDevices {
plist::to_writer_xml(f, &new_plist).unwrap();
}
// Read the file to a string
info!("Reading SystemConfiguration.plist");
debug!("Reading SystemConfiguration.plist");
let mut file = std::fs::File::open(path).unwrap();
let mut contents = Vec::new();
file.read_to_end(&mut contents).unwrap();

// Parse the string into a plist
info!("Parsing SystemConfiguration.plist");
debug!("Parsing SystemConfiguration.plist");
let plist = plist::from_bytes::<plist::Dictionary>(&contents).unwrap();
match plist.get("SystemBUID") {
Some(plist::Value::String(b)) => Ok(b.to_owned()),
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{fs, os::unix::prelude::PermissionsExt};

use crate::raw_packet::RawPacket;
use devices::SharedDevices;
use log::{error, info, trace, warn};
use log::{debug, error, info, trace, warn};
use tokio::{
io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt},
sync::Mutex,
Expand Down Expand Up @@ -215,7 +215,7 @@ async fn handle_stream(
};
trace!("Recv'd {size} bytes");
if size == 0 {
info!("Received size is zero, closing connection");
debug!("Received size is zero, closing connection");
return;
}

Expand Down

0 comments on commit 34aa8f4

Please sign in to comment.