Read Syslog
Stream device logs with syslog relay.
Use SyslogRelayClient to stream logs inside your own process:
This example uses the first_provider() helper from the examples overview.
use idevice::{IdeviceService, syslog_relay::SyslogRelayClient};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let provider = first_provider().await?;
// Syslog relay stays open and yields one log line at a time.
let mut syslog = SyslogRelayClient::connect(&provider).await?;
loop {
println!("{}", syslog.next().await?);
}
}Add the needed features:
[dependencies]
idevice = { version = "0.1.64", features = ["usbmuxd", "syslog_relay"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }To test from a terminal, start a live syslog stream:
idevice-tools syslog_relayPipe the stream into local tools when you want to filter or save output:
idevice-tools syslog_relay | rg SpringBoardidevice-tools syslog_relay > device.logStop the stream with Ctrl+C.