public LoggingConfiguration setProperties(Map<String, String> properties) { setVerbose(properties); return this; }
public LoggingConfiguration setVerbose(Map<String, String> props) { String logLevel = props.get("sonar.log.level"); String deprecatedProfilingLevel = props.get("sonar.log.profilingLevel"); verbose = "true".equals(props.get("sonar.verbose")) || "DEBUG".equals(logLevel) || "TRACE".equals(logLevel) || "BASIC".equals(deprecatedProfilingLevel) || "FULL".equals(deprecatedProfilingLevel); return setVerbose(verbose); }
public LoggingConfiguration(@Nullable EnvironmentInformation environment) { setVerbose(false); if (environment != null && "maven".equalsIgnoreCase(environment.getKey())) { setFormat(FORMAT_MAVEN); } else { setFormat(FORMAT_DEFAULT); } }
@Test public void testConfigureMultipleTimes() throws UnsupportedEncodingException { System.setOut(new PrintStream(out, false, StandardCharsets.UTF_8.name())); conf.setLogOutput(listener); LoggingConfigurator.apply(conf); Logger logger = LoggerFactory.getLogger(this.getClass()); logger.debug("debug"); assertThat(listener.msg).isNull(); conf.setVerbose(true); LoggingConfigurator.apply(conf); logger.debug("debug"); assertThat(listener.msg).isEqualTo("debug"); }
@Test public void testSetVerbose() { assertThat(new LoggingConfiguration(null).setVerbose(true) .getSubstitutionVariable(LoggingConfiguration.PROPERTY_ROOT_LOGGER_LEVEL)).isEqualTo(LoggingConfiguration.LEVEL_ROOT_VERBOSE); assertThat(new LoggingConfiguration(null).setVerbose(false) .getSubstitutionVariable(LoggingConfiguration.PROPERTY_ROOT_LOGGER_LEVEL)).isEqualTo(LoggingConfiguration.LEVEL_ROOT_DEFAULT); assertThat(new LoggingConfiguration(null).setRootLevel("ERROR") .getSubstitutionVariable(LoggingConfiguration.PROPERTY_ROOT_LOGGER_LEVEL)).isEqualTo("ERROR"); }
public LoggingConfiguration setProperties(Map<String, String> properties) { setVerbose(properties); return this; }
public LoggingConfiguration setVerbose(Map<String, String> props) { String logLevel = props.get("sonar.log.level"); String deprecatedProfilingLevel = props.get("sonar.log.profilingLevel"); verbose = "true".equals(props.get("sonar.verbose")) || "DEBUG".equals(logLevel) || "TRACE".equals(logLevel) || "BASIC".equals(deprecatedProfilingLevel) || "FULL".equals(deprecatedProfilingLevel); return setVerbose(verbose); }
public LoggingConfiguration setProperties(Map<String, String> properties) { String logLevel = properties.get("sonar.log.level"); String deprecatedProfilingLevel = properties.get("sonar.log.profilingLevel"); boolean verbose = "true".equals(properties.get("sonar.verbose")) || "DEBUG".equals(logLevel) || "TRACE".equals(logLevel) || "BASIC".equals(deprecatedProfilingLevel) || "FULL".equals(deprecatedProfilingLevel); boolean sql = "TRACE".equals(logLevel) || "FULL".equals(deprecatedProfilingLevel); setShowSql(sql); setVerbose(verbose); return this; }
public LoggingConfiguration setProperties(Map<String, String> properties) { setShowSql(properties, null); setVerbose(properties, null); return this; }
public LoggingConfiguration setProperties(Map<String, String> properties, @Nullable Map<String, String> fallback) { setShowSql(properties, fallback); setVerbose(properties, fallback); return this; }
public LoggingConfiguration setVerbose(Map<String, String> props, @Nullable Map<String, String> fallback) { String logLevel = getFallback("sonar.log.level", props, fallback); String deprecatedProfilingLevel = getFallback("sonar.log.profilingLevel", props, fallback); verbose = "true".equals(getFallback("sonar.verbose", props, fallback)) || "DEBUG".equals(logLevel) || "TRACE".equals(logLevel) || "BASIC".equals(deprecatedProfilingLevel) || "FULL".equals(deprecatedProfilingLevel); return setVerbose(verbose); }
private LoggingConfiguration(@Nullable EnvironmentInformation environment) { setVerbose(false); if (environment != null && "maven".equalsIgnoreCase(environment.getKey())) { setFormat(FORMAT_MAVEN); } else { setFormat(FORMAT_DEFAULT); } }
public LoggingConfiguration(@Nullable EnvironmentInformation environment) { setVerbose(false); if (environment != null && "maven".equalsIgnoreCase(environment.getKey())) { setFormat(FORMAT_MAVEN); } else { setFormat(FORMAT_DEFAULT); } }
public LoggingConfiguration(@Nullable EnvironmentInformation environment) { setVerbose(false); if (environment != null && "maven".equalsIgnoreCase(environment.getKey())) { setFormat(FORMAT_MAVEN); } else { setFormat(FORMAT_DEFAULT); } }