Skip to content

Commit

Permalink
Also wrap configuration with a LazyInitializer. (#182)
Browse files Browse the repository at this point in the history
* In the default flow it is not necessary. But since the DynamicLogLevelConfiguration is also exposed via the protected getConfiguration(), it is recreated on each invocation.
  • Loading branch information
j-denner authored Jul 9, 2024
1 parent 26565dc commit 437073e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ public DynamicLogLevelFilter() {
* use a lambda: {@code () -> config}
*/
public DynamicLogLevelFilter(ConcurrentInitializer<DynamicLogLevelConfiguration> configuration) {
this.configuration = configuration;
this.configuration = new LazyInitializer<DynamicLogLevelConfiguration>() {

@Override
protected DynamicLogLevelConfiguration initialize() throws ConcurrentException {
return configuration.get();
}
};
this.processor = new LazyInitializer<DynamicLogLevelProcessor>() {

@Override
Expand Down

0 comments on commit 437073e

Please sign in to comment.