broxus / tycho

Reference implementation of Tycho protocol.
https://tychoprotocol.com/
Apache License 2.0
21 stars 1 forks source link

log message debounce #406

Open Mododo opened 4 days ago

Mododo commented 4 days ago

We have some error messages that we neither want to hide totally under DEBUG level nor print several times per second. Some examples in mempool:

Add global map in tycho_utils that stores formatted strings for tracing outputs for some duration from node config. On first insert, log is printed. Same string should appear in log again only after duration passes. Map should not store messages for disabled log levels.

It's ok that map should be used with care to store only repeatable messages.

Mododo commented 4 days ago

previous work https://github.com/broxus/tycho/pull/349