caching enabled status per logger#799
Conversation
1 similar comment
|
Please explain what this does. What problem are you facing? |
|
Current implementation checks whether the namespace is enabled against the lists of regexes each time the debug instance is called. This change addresses this by caching the enabled flag in the debug instance to avoid reevaluating it each time. Since the library supports dynamically changing namespace configuration, the change also addresses this by caching reference to namespace config in the instance and comparing it against the current config (lazily). When the references are different the new config reference is replaces the previously cached one and the enabled flag reevaluated so nothing breaks but redundant regex checks are cut off. |
Qix-
left a comment
There was a problem hiding this comment.
Sounds good, thanks!
Just a few small nitpicks and I'll merge.
Co-authored-by: Qix <Qix-@users.noreply.github.com>
|
Released as |
Can we have this to avoid rechecking rules on each call?