Skip to content

Commit ecc2961

Browse files
committed
feat: change logs packet structure
1 parent 5a7f4c8 commit ecc2961

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,12 @@ async fn on_timer_response(
277277
}
278278
TimerPacketInner::Logs { logs } => {
279279
for log in logs.iter().rev() {
280-
for line in log.msg.lines() {
280+
for line in log.lines() {
281281
if line.is_empty() {
282282
continue;
283283
}
284284

285-
tracing::info!(file = format!("device_{esp_id}"), "[{}] {line}", log.millis);
285+
tracing::info!(file = format!("device_{esp_id}"), "{line}");
286286
}
287287
}
288288
}

src/structs.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ pub struct TimerPacket {
99
pub data: TimerPacketInner,
1010
}
1111

12-
#[derive(Serialize, Deserialize, Debug, Clone)]
13-
pub struct LogData {
14-
pub millis: u64,
15-
pub msg: String,
16-
}
17-
1812
#[derive(Serialize, Deserialize, Debug, Clone)]
1913
#[serde(rename_all = "snake_case")]
2014
pub enum TimerPacketInner {
@@ -71,7 +65,7 @@ pub enum TimerPacketInner {
7165
added: bool,
7266
},
7367
Logs {
74-
logs: Vec<LogData>,
68+
logs: Vec<String>,
7569
},
7670
Battery {
7771
level: Option<f64>,

0 commit comments

Comments
 (0)