Skip to content

Commit aaffc3c

Browse files
committed
small log fixes
1 parent 87d27eb commit aaffc3c

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

compute/src/reqres/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl TaskResponder {
124124
// prepare signed and encrypted payload
125125
log::info!(
126126
"Publishing {} result for {}",
127-
"task".green(),
127+
"task".yellow(),
128128
task_output.task_id
129129
);
130130
let payload = TaskResponsePayload::new(

compute/src/workers/task.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use colored::Colorize;
12
use dkn_p2p::libp2p::request_response::ResponseChannel;
23
use dkn_workflows::{Entry, ExecutionError, Executor, Workflow};
34
use libsecp256k1::PublicKey;
@@ -76,7 +77,7 @@ impl TaskWorker {
7677
let task = self.task_rx.recv().await;
7778

7879
if let Some(task) = task {
79-
log::info!("Processing task {} (single)", task.task_id);
80+
log::info!("Processing {} {} (single)", "task".yellow(), task.task_id);
8081
TaskWorker::execute((task, &self.publish_tx)).await
8182
} else {
8283
return self.shutdown();

p2p/src/behaviour.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use eyre::Result;
22
use libp2p::identity::{Keypair, PublicKey};
3-
use libp2p::{identify, request_response, PeerId, StreamProtocol};
3+
use libp2p::{identify, request_response, StreamProtocol};
44
use std::time::Duration;
55

66
#[derive(libp2p::swarm::NetworkBehaviour)]

p2p/src/client.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl DriaP2PClient {
288288
..
289289
} => {
290290
log::info!(
291-
"Connection (id: {connection_id}) established with peer {peer_id} ({} connections) at {:?}",
291+
"Connection ({connection_id}) established with peer {peer_id} ({} connections) at {:?}",
292292
num_established,
293293
endpoint
294294
);
@@ -302,9 +302,11 @@ impl DriaP2PClient {
302302
cause,
303303
} => {
304304
log::warn!(
305-
"Connection (id: {connection_id}) closed for {peer_id} ({} connections)\nCause: {}",
305+
"Connection ({connection_id}) closed for {peer_id} ({} connections)\nCause: {}",
306306
num_established,
307-
cause.map(|c| c.to_string()).unwrap_or("Unknown".to_string())
307+
cause
308+
.map(|c| c.to_string())
309+
.unwrap_or("Unknown".to_string())
308310
);
309311

310312
if endpoint.is_dialer() {
@@ -325,11 +327,11 @@ impl DriaP2PClient {
325327
address,
326328
listener_id,
327329
} => {
328-
log::warn!("Listener {listener_id} expired: {address}");
330+
log::warn!("Listener ({listener_id}) expired: {address}");
329331
}
330332

331333
SwarmEvent::ListenerError { listener_id, error } => {
332-
log::error!("Listener {listener_id} error: {error}");
334+
log::error!("Listener ({listener_id}) failed: {error}");
333335
}
334336

335337
event => log::debug!("Unhandled Swarm Event: {:?}", event),

0 commit comments

Comments
 (0)