Skip to content

Commit

Permalink
Log node-logs according to their level
Browse files Browse the repository at this point in the history
  • Loading branch information
erdemyerebasmaz committed Mar 19, 2024
1 parent a6d8c4d commit b544d81
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/sdk-core/src/breez_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,12 @@ impl BreezServices {
log_message_res = log_stream.message() => {
match log_message_res {
Ok(Some(l)) => {
debug!("node-logs: {}", l.line);
match l.line.to_ascii_lowercase() {
s if s.starts_with("info") => info!("node-logs: {}", l.line.split_at(4).1.trim_start()),
s if s.starts_with("debug") => debug!("node-logs: {}", l.line.split_at(5).1.trim_start()),
s if s.starts_with("unusual") => trace!("node-logs: {}", l.line.split_at(7).1.trim_start()),
_ => trace!("node-logs: {}", l.line)
}
},
// stream is closed, renew it
Ok(None) => {
Expand Down

0 comments on commit b544d81

Please sign in to comment.