aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-12-04 14:06:06 +0100
committerAlex Auvolat <alex@adnab.me>2020-12-04 14:06:06 +0100
commit0b041c77f4167fcb0d2d8445b736757af7b8208d (patch)
treead62376f5dad1b0605e46874effe2c2673b40780
parentb63179c699e0569d45826bccb4b9f2f1bc53c30e (diff)
downloadnetapp-0b041c77f4167fcb0d2d8445b736757af7b8208d.tar.gz
netapp-0b041c77f4167fcb0d2d8445b736757af7b8208d.zip
more logging
-rw-r--r--examples/basalt.rs3
-rw-r--r--examples/fullmesh.rs3
-rw-r--r--src/peering/basalt.rs12
3 files changed, 13 insertions, 5 deletions
diff --git a/examples/basalt.rs b/examples/basalt.rs
index 141069a..ea1ea7d 100644
--- a/examples/basalt.rs
+++ b/examples/basalt.rs
@@ -53,8 +53,9 @@ async fn main() {
.parse_env("RUST_LOG")
.format(|buf, record| {
writeln!(buf,
- "{} {} {}",
+ "{} {} {} {}",
chrono::Local::now().format("%s%.6f"),
+ record.module_path().unwrap_or("_"),
record.level(),
record.args()
)
diff --git a/examples/fullmesh.rs b/examples/fullmesh.rs
index a61ab3d..a24d343 100644
--- a/examples/fullmesh.rs
+++ b/examples/fullmesh.rs
@@ -32,8 +32,9 @@ async fn main() {
.parse_env("RUST_LOG")
.format(|buf, record| {
writeln!(buf,
- "{} {} {}",
+ "{} {} {} {}",
chrono::Local::now().format("%s%.6f"),
+ record.module_path().unwrap_or("_"),
record.level(),
record.args()
)
diff --git a/src/peering/basalt.rs b/src/peering/basalt.rs
index 00cfd60..c1f697e 100644
--- a/src/peering/basalt.rs
+++ b/src/peering/basalt.rs
@@ -339,6 +339,7 @@ impl Basalt {
{
Ok(resp) => {
self.handle_peer_list(&resp.peers[..]);
+ info!("KYEV PEXi {}", hex::encode(peer));
}
Err(e) => {
warn!("Error during pull exchange: {}", e);
@@ -348,8 +349,13 @@ impl Basalt {
async fn do_push(self: Arc<Self>, peer: ed25519::PublicKey) {
let push_msg = self.make_push_message();
- if let Err(e) = self.netapp.request(&peer, push_msg, PRIO_NORMAL).await {
- warn!("Error during push exchange: {}", e);
+ match self.netapp.request(&peer, push_msg, PRIO_NORMAL).await {
+ Ok(_) => {
+ info!("KYEV PEXo {}", hex::encode(peer));
+ }
+ Err(e) => {
+ warn!("Error during push exchange: {}", e);
+ }
}
}
@@ -424,7 +430,7 @@ impl Basalt {
if is_incoming {
self.handle_peer_list(&[Peer { id: pk, addr }][..]);
} else {
- info!("KYEV C {}", hex::encode(pk));
+ info!("KYEV C {} {}", hex::encode(pk), addr);
let peer = Peer { id: pk, addr };
let mut backlog = self.backlog.write().unwrap();