Unverified Commit 9e6a84af authored by Ryan McCormick's avatar Ryan McCormick Committed by GitHub
Browse files

chore(style): Log with {var} style in lib/runtime (#6757)

parent 72eabeae
...@@ -63,7 +63,7 @@ impl GracefulShutdownTracker { ...@@ -63,7 +63,7 @@ impl GracefulShutdownTracker {
let notified = self.shutdown_complete.notified(); let notified = self.shutdown_complete.notified();
let count = self.active_endpoints.load(Ordering::SeqCst); let count = self.active_endpoints.load(Ordering::SeqCst);
tracing::trace!("Checking completion status, active endpoints: {}", count); tracing::trace!("Checking completion status, active endpoints: {count}");
if count == 0 { if count == 0 {
tracing::debug!("All endpoints completed"); tracing::debug!("All endpoints completed");
...@@ -71,7 +71,7 @@ impl GracefulShutdownTracker { ...@@ -71,7 +71,7 @@ impl GracefulShutdownTracker {
} }
// Only wait if there are still active endpoints // Only wait if there are still active endpoints
tracing::debug!("Waiting for {} endpoints to complete", count); tracing::debug!("Waiting for {count} endpoints to complete");
notified.await; notified.await;
tracing::trace!("Received notification, rechecking..."); tracing::trace!("Received notification, rechecking...");
} }
......
...@@ -100,12 +100,12 @@ where ...@@ -100,12 +100,12 @@ where
loop { loop {
tokio::select! { tokio::select! {
_ = cancellation_token.cancelled() => { _ = cancellation_token.cancelled() => {
tracing::debug!("TypedPrefixWatcher for prefix '{}' cancelled", prefix_str); tracing::debug!("TypedPrefixWatcher for prefix '{prefix_str}' cancelled");
break; break;
} }
event = events_rx.recv() => { event = events_rx.recv() => {
let Some(event) = event else { let Some(event) = event else {
tracing::debug!("TypedPrefixWatcher watch stream closed for prefix '{}'", prefix_str); tracing::debug!("TypedPrefixWatcher watch stream closed for prefix '{prefix_str}'");
break; break;
}; };
...@@ -163,7 +163,7 @@ where ...@@ -163,7 +163,7 @@ where
} }
} }
tracing::debug!("TypedPrefixWatcher for prefix '{}' stopped", prefix_str); tracing::debug!("TypedPrefixWatcher for prefix '{prefix_str}' stopped");
}); });
Ok(TypedPrefixWatcher { rx: watch_rx }) Ok(TypedPrefixWatcher { rx: watch_rx })
......
...@@ -155,7 +155,7 @@ impl Worker { ...@@ -155,7 +155,7 @@ impl Worker {
tokio::select! { tokio::select! {
_ = cancel_token.cancelled() => { _ = cancel_token.cancelled() => {
tracing::debug!("{}", SHUTDOWN_MESSAGE); tracing::debug!("{SHUTDOWN_MESSAGE}");
tracing::debug!("{} {} seconds", SHUTDOWN_TIMEOUT_MESSAGE, timeout); tracing::debug!("{} {} seconds", SHUTDOWN_TIMEOUT_MESSAGE, timeout);
} }
......
...@@ -314,7 +314,7 @@ where ...@@ -314,7 +314,7 @@ where
// todo(metrics): increment metric counter for bytes received // todo(metrics): increment metric counter for bytes received
// todo(metrics): increment metric counter for requests received // todo(metrics): increment metric counter for requests received
let id = req.id.clone(); let id = req.id.clone();
tracing::debug!("[ingress] received request [id: {}]", id); tracing::debug!("[ingress] received request [id: {id}]");
// deserialize the request // deserialize the request
let request = serde_json::from_slice::<T>(&req.request) let request = serde_json::from_slice::<T>(&req.request)
...@@ -353,18 +353,18 @@ where ...@@ -353,18 +353,18 @@ where
.await .await
.expect("failed to send handshake"); .expect("failed to send handshake");
tracing::trace!("[ingress] handshake sent [id: {}]", id); tracing::trace!("[ingress] handshake sent [id: {id}]");
if let Ok(response) = response { if let Ok(response) = response {
// spawn a task to process the response stream: // spawn a task to process the response stream:
// - serialize each response // - serialize each response
// - forward the bytes to the data plane // - forward the bytes to the data plane
tracing::debug!("[ingress] processing response stream [id: {}]", id); tracing::debug!("[ingress] processing response stream [id: {id}]");
tokio::spawn(async move { tokio::spawn(async move {
let mut response = response; let mut response = response;
while let Some(resp) = response.next().await { while let Some(resp) = response.next().await {
tracing::trace!("[ingress] received response [id: {}]", id); tracing::trace!("[ingress] received response [id: {id}]");
let resp_bytes = serde_json::to_vec(&resp) let resp_bytes = serde_json::to_vec(&resp)
.expect("failed to serialize response"); .expect("failed to serialize response");
...@@ -380,10 +380,10 @@ where ...@@ -380,10 +380,10 @@ where
.await .await
.expect("failed to send response"); .expect("failed to send response");
tracing::trace!("[ingress] sent response [id: {}]", id); tracing::trace!("[ingress] sent response [id: {id}]");
} }
tracing::debug!("response stream completed [id: {}]", id); tracing::debug!("response stream completed [id: {id}]");
}); });
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment