Skip to content

Conversation

@soumyasen1809
Copy link

Add the log_every_n macro that will log an event after every n steps.
Fixes issue #3457

The pull request introduces a log_every_n! macro designed to address logging overhead in high-throughput systems by logging an event only after a specified number of steps. The macro utilizes std::sync::atomic::AtomicUsize for atomic thread-safety.

Motivation

Potentially improve the performance for heavy logging systems by not spamming the system.

Solution

Add log_every_n macro that logs at every n steps.

Add the log_every_n macro that will log an event after
every n steps.
Fixes issue tokio-rs#3457
@soumyasen1809 soumyasen1809 requested review from a team, hawkw and hds as code owners February 9, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant