print node ID as integer in logging (#54)
This commit is contained in:
parent
590e9c289f
commit
091a60ae4e
|
@ -13,7 +13,7 @@ use lottery::StakeLottery;
|
||||||
use message::{Payload, PayloadId};
|
use message::{Payload, PayloadId};
|
||||||
use multiaddr::Multiaddr;
|
use multiaddr::Multiaddr;
|
||||||
use netrunner::network::NetworkMessage;
|
use netrunner::network::NetworkMessage;
|
||||||
use netrunner::node::{Node, NodeId};
|
use netrunner::node::{Node, NodeId, NodeIdExt};
|
||||||
use netrunner::{
|
use netrunner::{
|
||||||
network::{InMemoryNetworkInterface, NetworkInterface, PayloadSize},
|
network::{InMemoryNetworkInterface, NetworkInterface, PayloadSize},
|
||||||
warding::WardCondition,
|
warding::WardCondition,
|
||||||
|
@ -275,7 +275,7 @@ impl MixNode {
|
||||||
let log = MessageLog {
|
let log = MessageLog {
|
||||||
payload_id: payload.id(),
|
payload_id: payload.id(),
|
||||||
step_id: self.state.step_id,
|
step_id: self.state.step_id,
|
||||||
node_id: format!("{}", self.id),
|
node_id: self.id.index(),
|
||||||
};
|
};
|
||||||
tracing::info!("{}: {}", tag, serde_json::to_string(&log).unwrap());
|
tracing::info!("{}: {}", tag, serde_json::to_string(&log).unwrap());
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ impl MixNode {
|
||||||
EmissionLog {
|
EmissionLog {
|
||||||
emission_type: emission_type.to_string(),
|
emission_type: emission_type.to_string(),
|
||||||
step_id: self.state.step_id,
|
step_id: self.state.step_id,
|
||||||
node_id: format!("{}", self.id),
|
node_id: self.id.index(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -391,12 +391,12 @@ impl Node for MixNode {
|
||||||
struct MessageLog {
|
struct MessageLog {
|
||||||
payload_id: PayloadId,
|
payload_id: PayloadId,
|
||||||
step_id: usize,
|
step_id: usize,
|
||||||
node_id: String,
|
node_id: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
struct EmissionLog {
|
struct EmissionLog {
|
||||||
emission_type: String,
|
emission_type: String,
|
||||||
step_id: usize,
|
step_id: usize,
|
||||||
node_id: String,
|
node_id: usize,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue