@Test public void testLogUrlWithBasicAuth() throws Exception { class Provider extends ConfigurationOptionProvider { private ConfigurationOption<List<URL>> urlBasicAuthOption = ConfigurationOption.urlsOption() .key("foo") .buildRequired(); } final ConfigurationRegistry configurationRegistry = ConfigurationRegistry.builder() .addOptionProvider(new Provider()) .addConfigSource(new SimpleSource("source").add("foo", "http: .build(); configurationLogger.logConfiguration(configurationRegistry); verify(logger).info(startsWith("# stagemonitor configuration")); verify(logger).info(eq("{}: {} (source: {})"), eq("foo"), eq("http: }
public void logConfiguration(ConfigurationRegistry configuration) { logger.info("# stagemonitor configuration, listing non-default values:"); boolean hasOnlyDefaultOptions = true; for (List<ConfigurationOption<?>> options : configuration.getConfigurationOptionsByCategory().values()) { for (ConfigurationOption<?> option : options) { if (!option.isDefault()) { hasOnlyDefaultOptions = false; logger.info("{}: {} (source: {})", option.getKey(), prepareOptionValueForLog(option), option.getNameOfCurrentConfigurationSource()); if (option.getTags().contains("deprecated")) { logger.warn("Detected usage of deprecated configuration option '{}'. " + "This option might be removed in the future. " + "Please refer to the documentation about alternatives.", option.getKey()); } if (!option.getKey().equals(option.getUsedKey())) { logger.warn("Detected usage of an old configuration key: '{}'. Please use '{}' instead.", option.getUsedKey(), option.getKey()); } } } } if (hasOnlyDefaultOptions) { logger.warn("stagemonitor has not been configured. Have a look at " + "https: "and " + "https: "for further instructions"); } }
ConfigurationLogger { public void logConfiguration(ConfigurationRegistry configuration) { logger.info("# stagemonitor configuration, listing non-default values:"); boolean hasOnlyDefaultOptions = true; for (List<ConfigurationOption<?>> options : configuration.getConfigurationOptionsByCategory().values()) { for (ConfigurationOption<?> option : options) { if (!option.isDefault()) { hasOnlyDefaultOptions = false; logger.info("{}: {} (source: {})", option.getKey(), prepareOptionValueForLog(option), option.getNameOfCurrentConfigurationSource()); if (option.getTags().contains("deprecated")) { logger.warn("Detected usage of deprecated configuration option '{}'. " + "This option might be removed in the future. " + "Please refer to the documentation about alternatives.", option.getKey()); } if (!option.getKey().equals(option.getUsedKey())) { logger.warn("Detected usage of an old configuration key: '{}'. Please use '{}' instead.", option.getUsedKey(), option.getKey()); } } } } if (hasOnlyDefaultOptions) { logger.warn("stagemonitor has not been configured. Have a look at " + "https: "and " + "https: "for further instructions"); } } }
ConfigurationLogger { public void logConfiguration(ConfigurationRegistry configuration) { logger.info("# stagemonitor configuration, listing non-default values:"); boolean hasOnlyDefaultOptions = true; for (List<ConfigurationOption<?>> options : configuration.getConfigurationOptionsByCategory().values()) { for (ConfigurationOption<?> option : options) { if (!option.isDefault()) { hasOnlyDefaultOptions = false; logger.info("{}: {} (source: {})", option.getKey(), prepareOptionValueForLog(option), option.getNameOfCurrentConfigurationSource()); if (option.getTags().contains("deprecated")) { logger.warn("Detected usage of deprecated configuration option '{}'. " + "This option might be removed in the future. " + "Please refer to the documentation about alternatives.", option.getKey()); } if (!option.getKey().equals(option.getUsedKey())) { logger.warn("Detected usage of an old configuration key: '{}'. Please use '{}' instead.", option.getUsedKey(), option.getKey()); } } } } if (hasOnlyDefaultOptions) { logger.warn("stagemonitor has not been configured. Have a look at " + "https: "and " + "https: "for further instructions"); } } ConfigurationLogger();  ConfigurationLogger(Logger logger); }
ConfigurationLogger { public void logConfiguration(ConfigurationRegistry configuration) { logger.info("# stagemonitor configuration, listing non-default values:"); boolean hasOnlyDefaultOptions = true; for (List<ConfigurationOption<?>> options : configuration.getConfigurationOptionsByCategory().values()) { for (ConfigurationOption<?> option : options) { if (!option.isDefault()) { hasOnlyDefaultOptions = false; logger.info("{}: {} (source: {})", option.getKey(), prepareOptionValueForLog(option), option.getNameOfCurrentConfigurationSource()); if (option.getTags().contains("deprecated")) { logger.warn("Detected usage of deprecated configuration option '{}'. " + "This option might be removed in the future. " + "Please refer to the documentation about alternatives.", option.getKey()); } if (!option.getKey().equals(option.getUsedKey())) { logger.warn("Detected usage of an old configuration key: '{}'. Please use '{}' instead.", option.getUsedKey(), option.getKey()); } } } } if (hasOnlyDefaultOptions) { logger.warn("stagemonitor has not been configured. Have a look at " + "https: "and " + "https: "for further instructions"); } } ConfigurationLogger();  ConfigurationLogger(Logger logger); void logConfiguration(ConfigurationRegistry configuration); }
ConfigurationLogger { public void logConfiguration(ConfigurationRegistry configuration) { logger.info("# stagemonitor configuration, listing non-default values:"); boolean hasOnlyDefaultOptions = true; for (List<ConfigurationOption<?>> options : configuration.getConfigurationOptionsByCategory().values()) { for (ConfigurationOption<?> option : options) { if (!option.isDefault()) { hasOnlyDefaultOptions = false; logger.info("{}: {} (source: {})", option.getKey(), prepareOptionValueForLog(option), option.getNameOfCurrentConfigurationSource()); if (option.getTags().contains("deprecated")) { logger.warn("Detected usage of deprecated configuration option '{}'. " + "This option might be removed in the future. " + "Please refer to the documentation about alternatives.", option.getKey()); } if (!option.getKey().equals(option.getUsedKey())) { logger.warn("Detected usage of an old configuration key: '{}'. Please use '{}' instead.", option.getUsedKey(), option.getKey()); } } } } if (hasOnlyDefaultOptions) { logger.warn("stagemonitor has not been configured. Have a look at " + "https: "and " + "https: "for further instructions"); } } ConfigurationLogger();  ConfigurationLogger(Logger logger); void logConfiguration(ConfigurationRegistry configuration);  }