Add msg type in the log (#46)

This commit is contained in:
Youngjoon Lee 2024-11-09 09:36:26 +07:00 committed by GitHub
parent a25bc27d09
commit b66d7abf9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -258,8 +258,8 @@ impl MixNode {
self.slot_update_sender.send(elapsed).unwrap();
}
fn log_message_generated(&self, payload: &Payload) {
self.log_message("MessageGenerated", payload);
fn log_message_generated(&self, msg_type: &str, payload: &Payload) {
self.log_message(format!("{}MessageGenerated", msg_type).as_str(), payload);
}
fn log_message_fully_unwrapped(&self, payload: &Payload) {
@ -297,7 +297,7 @@ impl Node for MixNode {
if let Poll::Ready(Some(_)) = pin!(&mut self.data_msg_lottery_interval).poll_next(&mut cx) {
if self.data_msg_lottery.run() {
let payload = Payload::new();
self.log_message_generated(&payload);
self.log_message_generated("Data", &payload);
let message = self
.crypto_processor
.wrap_message(payload.as_bytes())
@ -335,7 +335,7 @@ impl Node for MixNode {
// Generate a cover message probabilistically
if let Poll::Ready(Some(_)) = pin!(&mut self.cover_traffic).poll_next(&mut cx) {
let payload = Payload::new();
self.log_message_generated(&payload);
self.log_message_generated("Cover", &payload);
let message = self
.crypto_processor
.wrap_message(payload.as_bytes())