Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to @ConfigMapping #323

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class LoggingManagerConfig {
String basePath;

/**
* Whether or not to include the Logger Manager endpoints in the generated OpenAPI document
* Whether to include the Logger Manager endpoints in the generated OpenAPI document
*/
@ConfigItem(name = "openapi.included", defaultValue = "false")
boolean openapiIncluded;
Expand All @@ -25,9 +25,9 @@ public class LoggingManagerConfig {
String openapiTag;

/**
* Always include this. By default this will always be included.
* Always include this. By default, this will always be included.
* Setting this to false will also exclude this in Prod
*/
@ConfigItem(defaultValue = "true")
boolean alwaysInclude;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ a|icon:lock[title=Fixed at build time] [[quarkus-logging-manager_quarkus-logging

[.description]
--
Whether or not to include the Logger Manager endpoints in the generated OpenAPI document
Whether to include the Logger Manager endpoints in the generated OpenAPI document

ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_LOGGING_MANAGER_OPENAPI_INCLUDED+++[]
Expand Down Expand Up @@ -66,7 +66,7 @@ a|icon:lock[title=Fixed at build time] [[quarkus-logging-manager_quarkus-logging

[.description]
--
Always include this. By default this will always be included. Setting this to false will also exclude this in Prod
Always include this. By default, this will always be included. Setting this to false will also exclude this in Prod

ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_LOGGING_MANAGER_ALWAYS_INCLUDE+++[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public Handler<RoutingContext> levelHandler() {
}

public Consumer<Route> routeConsumer(Handler<RoutingContext> bodyHandler, LoggingManagerRuntimeConfig runtimeConfig) {
if (runtimeConfig.enable) {
if (runtimeConfig.enable()) {
return new Consumer<Route>() {
@Override
public void accept(Route route) {
Expand All @@ -36,4 +36,4 @@ public void accept(Route route) {
}

}
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package io.quarkiverse.loggingmanager;

import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;

@ConfigRoot(name = "logging-manager", phase = ConfigPhase.RUN_TIME)
public class LoggingManagerRuntimeConfig {
@ConfigMapping(prefix = "quarkus.logging-manager")
@ConfigRoot(phase = ConfigPhase.RUN_TIME)
public interface LoggingManagerRuntimeConfig {

/**
* If Logging Manager should be enabled. By default, Logging Manager is enabled if it is included (see
* {@code always-include}).
*/
@ConfigItem(name = "enable", defaultValue = "true")
boolean enable;
@WithDefault("true")
boolean enable();
}