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