diff --git a/services/hanke-service/src/main/kotlin/fi/hel/haitaton/hanke/configuration/FeatureFlags.kt b/services/hanke-service/src/main/kotlin/fi/hel/haitaton/hanke/configuration/FeatureFlags.kt index 70768b52d..110362432 100644 --- a/services/hanke-service/src/main/kotlin/fi/hel/haitaton/hanke/configuration/FeatureFlags.kt +++ b/services/hanke-service/src/main/kotlin/fi/hel/haitaton/hanke/configuration/FeatureFlags.kt @@ -1,11 +1,22 @@ package fi.hel.haitaton.hanke.configuration import fi.hel.haitaton.hanke.EndpointDisabledException +import mu.KotlinLogging +import org.springframework.boot.context.event.ApplicationReadyEvent import org.springframework.boot.context.properties.ConfigurationProperties +import org.springframework.context.event.EventListener + +private val logger = KotlinLogging.logger {} @ConfigurationProperties(prefix = "haitaton") data class FeatureFlags(val features: Map) { + @EventListener(ApplicationReadyEvent::class) + fun logWarning() { + logger.info { "Listing feature flags:" } + features.forEach { logger.info { "Feature ${it.key} is ${it.value}" } } + } + /** Disabled by default, if not in application.properties. */ private fun isEnabled(feature: Feature): Boolean = features.getOrDefault(feature, false)