Skip to content

Commit

Permalink
print logline if failed to parse
Browse files Browse the repository at this point in the history
  • Loading branch information
noisyscanner committed Oct 21, 2024
1 parent c6a72b5 commit 70ec7ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion metrics/src/logprocessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ async fn handle_websocket_log(log: &BaseLog, metric_obj: &Telemetry) {
}

pub async fn log_processor(logline: &String, metric_obj: &Telemetry, tracer: &trace::Tracer) {
println!("{}", logline);
println!("{}", logline); // TODO: strip blank lines?
metric_obj.LOG_LINES_COUNTER_TOTAL.inc();
let log_result = from_str::<BaseLog>(logline);
match log_result {
Expand Down Expand Up @@ -220,6 +220,7 @@ pub async fn log_processor(logline: &String, metric_obj: &Telemetry, tracer: &tr
}
Err(e) => {
warn!("Failed to parse log line: {}", e);
warn!("Line was: {}", logline);
}
};
}

0 comments on commit 70ec7ad

Please sign in to comment.