clean: remove unnecessary blocks

This commit is contained in:
Einliterflasche 2024-08-20 14:25:19 +02:00
parent 853164b7c7
commit 0ec1e91539

View File

@ -104,20 +104,12 @@ pub async fn get_logs(logs_dir: PathBuf, swap_id: Option<Uuid>, redact_addresses
while let Some(line) = lines.next_line().await? {
// if we should filter by swap id, check if the line contains it
if let Some(swap_id) = swap_id {
// we only want lines which contain the swap id
if !line.contains(&swap_id.to_string()) {
continue;
}
}
if line.contains(r#""level":"TRACE""#) {
continue;
}
// skip debug logs
if line.contains(r#""level":"DEBUG""#) {
continue;
}
// redact if necessary
let line = if redact_addresses { redact_with(&line, &mut placeholders) } else { line };
// save redacted message