Skip to content

Commit

Permalink
Cleanup property values
Browse files Browse the repository at this point in the history
  • Loading branch information
agentgt committed Feb 8, 2024
1 parent b533a9b commit 2eedc98
Show file tree
Hide file tree
Showing 3 changed files with 309 additions and 307 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/io/jstach/rainbowgum/LogConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.jstach.rainbowgum.LevelResolver.LevelConfig;
import io.jstach.rainbowgum.LogConfig.ChangePublisher;
import io.jstach.rainbowgum.LogProperties.PropertyGetter;
import io.jstach.rainbowgum.LogProperties.PropertyGetter.RequiredPropertyGetter;
import io.jstach.rainbowgum.spi.RainbowGumServiceProvider;
import io.jstach.rainbowgum.spi.RainbowGumServiceProvider.Configurator;
import io.jstach.rainbowgum.spi.RainbowGumServiceProvider.PropertiesProvider;
Expand Down Expand Up @@ -269,7 +270,7 @@ private static LogProperties provideProperties(ServiceRegistry registry,

abstract class AbstractChangePublisher implements ChangePublisher {

static final PropertyGetter<Boolean> changeSetting = PropertyGetter.of()
static final RequiredPropertyGetter<Boolean> changeSetting = PropertyGetter.of()
.withSearch(LogProperties.CHANGE_PREFIX)
.map(s -> Boolean.parseBoolean(s))
.orElse(false);
Expand All @@ -293,8 +294,7 @@ public void subscribe(Consumer<? super LogConfig> consumer) {

@Override
public boolean isEnabled(String loggerName) {
return changeSetting.value(_config().properties(), loggerName);

return changeSetting.get(_config().properties(), loggerName).value();
}

}
Expand Down
Loading

0 comments on commit 2eedc98

Please sign in to comment.