Skip to content

Commit

Permalink
Merge pull request #90 from arkedge/trace_log
Browse files Browse the repository at this point in the history
フォワーディングのtraceログを出す
  • Loading branch information
KOBA789 authored May 10, 2024
2 parents 60c349b + b0069ed commit 86b320e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kble/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use anyhow::{Context, Result};
use futures::{future, SinkExt, StreamExt};
use std::collections::HashMap;
use tokio::sync::broadcast;
use tracing::{debug, warn};
use tracing::{debug, trace, warn};

struct Connection {
backend: plug::Backend,
Expand Down Expand Up @@ -207,10 +207,17 @@ impl<'a> Link<'a> {
Ok(data) => data,
};

let data_len = data.len();
if let Err(e) = self.dest.send(data).await {
warn!("Error writing to {}: {}", self.dest_name, e);
break;
}
trace!(
"{} -> {}: {} bytes",
self.source_name,
self.dest_name,
data_len
);
}
self
}
Expand Down
1 change: 1 addition & 0 deletions kble/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ async fn main() -> Result<()> {
)
.with(EnvFilter::from_default_env())
.init();
tracing::info!("Starting");

let args = Args::parse_with_license_notice(include_notice!());
let config = args.load_spaghetti_config()?;
Expand Down

0 comments on commit 86b320e

Please sign in to comment.