mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 06:26:15 +01:00
Implement ser/de for OsTraceRelay outputs
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -369,6 +369,7 @@ dependencies = [
|
||||
"iana-time-zone",
|
||||
"js-sys",
|
||||
"num-traits",
|
||||
"serde",
|
||||
"wasm-bindgen",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
@@ -30,7 +30,9 @@ base64 = { version = "0.22" }
|
||||
|
||||
indexmap = { version = "2.7", features = ["serde"], optional = true }
|
||||
uuid = { version = "1.12", features = ["serde", "v4"], optional = true }
|
||||
chrono = { version = "0.4.40", optional = true, default-features = false }
|
||||
chrono = { version = "0.4.40", optional = true, default-features = false, features = [
|
||||
"serde",
|
||||
] }
|
||||
|
||||
serde_json = { version = "1", optional = true }
|
||||
json = { version = "0.12", optional = true }
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//! https://github.com/doronz88/pymobiledevice3/blob/master/pymobiledevice3/services/os_trace.py
|
||||
|
||||
use chrono::{DateTime, NaiveDateTime};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::io::AsyncWriteExt;
|
||||
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, obf};
|
||||
@@ -30,7 +31,7 @@ pub struct OsTraceRelayReceiver {
|
||||
inner: OsTraceRelayClient,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct OsTraceLog {
|
||||
pub pid: u32,
|
||||
pub timestamp: NaiveDateTime,
|
||||
@@ -41,13 +42,13 @@ pub struct OsTraceLog {
|
||||
pub label: Option<SyslogLabel>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct SyslogLabel {
|
||||
pub subsystem: String,
|
||||
pub category: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum LogLevel {
|
||||
Notice = 0,
|
||||
Info = 1,
|
||||
|
||||
Reference in New Issue
Block a user