Skip to content

Commit

Permalink
Merge pull request #267 from superfly/log-pow
Browse files Browse the repository at this point in the history
Fix function for logging every pow of 10
  • Loading branch information
somtochiama authored Nov 28, 2024
2 parents a9ad85f + 5ef9168 commit fca1326
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion crates/corro-agent/src/agent/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,8 @@ pub fn check_buffered_meta_to_clear(
}

pub fn log_at_pow_10(msg: &str, count: &mut u64) {
if is_pow_10(*count + 1) {
*count += 1;
if is_pow_10(*count) {
warn!("{} (log count: {})", msg, count)
}
// reset count
Expand Down
2 changes: 1 addition & 1 deletion crates/corro-agent/src/broadcast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ async fn handle_broadcasts(
}

if drop_oldest_broadcast(&mut to_broadcast, max_queue_len).is_some() {
log_at_pow_10("dropped old change from queue", &mut log_count);
log_at_pow_10("dropped old change from broadcast queue", &mut log_count);
}
}

Expand Down

0 comments on commit fca1326

Please sign in to comment.