From 36cd8fdeea9e61d3013f40e83e0fb5592a8301f3 Mon Sep 17 00:00:00 2001 From: Sebastian Rollen Date: Wed, 16 Jun 2021 18:08:55 -0400 Subject: [PATCH] better logging --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/relay.rs | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4a047fc..07b63d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1437,7 +1437,7 @@ dependencies = [ [[package]] name = "polygon-data-relay" -version = "1.2.5" +version = "1.2.6" dependencies = [ "actix-service", "actix-web", diff --git a/Cargo.toml b/Cargo.toml index b48dc63..a70acb0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polygon-data-relay" -version = "1.2.5" +version = "1.2.6" authors = ["Sebastian Rollen "] edition = "2018" diff --git a/src/relay.rs b/src/relay.rs index 0576b11..5b7ab84 100644 --- a/src/relay.rs +++ b/src/relay.rs @@ -21,7 +21,7 @@ pub async fn run( loop { let msg = rx.recv().expect("Failed to receive message"); let msg_str = serde_json::to_string(&msg).expect("Failed to serialize command"); - info!("Control message received: {}", &msg_str); + info!(%msg_str); sink.send(msg_str) .await .map_err(|_| anyhow!("Failed to send message to Sink")) @@ -47,23 +47,23 @@ pub async fn run( let payload = serde_json::to_string(&polygon_message); match payload { Ok(payload) => { - debug!(?polygon_message, ?key, ?topic); + debug!(%payload, %key, %topic); let res = producer .send( FutureRecord::to(topic).key(key).payload(&payload), Duration::from_secs(0), ) .await; - if let Err((e, msg)) = res { + if let Err((e, _)) = res { let e = e.into(); sentry_anyhow::capture_anyhow(&e); - error!(?msg, %e) + error!(%e, %payload) } } Err(e) => { let e = e.into(); sentry_anyhow::capture_anyhow(&e); - error!(%e, ?polygon_message) + error!(%e) } } }