logo
pub struct InterestCacheConfig { /* private fields */ }
Expand description

The interest cache configuration.

Implementations

Sets the minimum logging verbosity for which the cache will apply.

The interest for logs with a lower verbosity than specified here will not be cached.

It should be set to the lowest verbosity level for which the majority of the logs in your application are usually disabled.

In normal circumstances with typical logger usage patterns you shouldn’t ever have to change this.

By default this is set to Debug.

Sets the number of entries in the LRU cache used to cache interests for log records.

The bigger the cache, the more unlikely it will be for the interest in a given callsite to be recalculated, at the expense of extra memory usage per every thread which tries to log events.

Every unique level + target pair consumes a single slot in the cache. Entries will be added to the cache until its size reaches the value configured here, and from then on it will evict the least recently seen level + target pair when adding a new entry.

The ideal value to set here widely depends on how much exactly you’re logging, and how diverse the targets are to which you are logging.

If your application spends a significant amount of time filtering logs which are not getting printed out then increasing this value will most likely help.

Setting this to zero will disable the cache.

By default this is set to 1024.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.