tracing_core::callsite

Function rebuild_interest_cache

Source
pub fn rebuild_interest_cache()
Expand description

Clear and reregister interest on every Callsite

This function is intended for runtime reconfiguration of filters on traces when the filter recalculation is much less frequent than trace events are. The alternative is to have the collector that supports runtime reconfiguration of filters always return Interest::sometimes() so that enabled is evaluated for every event.

This function will also re-compute the global maximum level as determined by the max_level_hint method. If a Collect implementation changes the value returned by its max_level_hint implementation at runtime, then it must call this function after that value changes, in order for the change to be reflected.

See the documentation on callsite interest caching for additional information on this function’s usage.