Polish
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -111,8 +111,8 @@ public class JavaLoggingSystem extends AbstractLoggingSystem {
|
||||
@Override
|
||||
public void setLogLevel(String loggerName, LogLevel level) {
|
||||
Assert.notNull(level, "Level must not be null");
|
||||
Logger logger = Logger
|
||||
.getLogger(StringUtils.hasText(loggerName) ? loggerName : "");
|
||||
String name = (StringUtils.hasText(loggerName) ? loggerName : "");
|
||||
Logger logger = Logger.getLogger(name);
|
||||
logger.setLevel(LEVELS.get(level));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -208,10 +208,9 @@ public class Log4J2LoggingSystem extends Slf4JLoggingSystem {
|
||||
return getLoggerContext().getConfiguration().getLoggerConfig("");
|
||||
}
|
||||
|
||||
private LoggerConfig getLoggerConfig(String loggerName) {
|
||||
loggerName = StringUtils.hasText(loggerName) ? loggerName
|
||||
: LogManager.ROOT_LOGGER_NAME;
|
||||
return getLoggerContext().getConfiguration().getLoggers().get(loggerName);
|
||||
private LoggerConfig getLoggerConfig(String name) {
|
||||
name = (StringUtils.hasText(name) ? name : LogManager.ROOT_LOGGER_NAME);
|
||||
return getLoggerContext().getConfiguration().getLoggers().get(name);
|
||||
}
|
||||
|
||||
private LoggerContext getLoggerContext() {
|
||||
|
||||
@@ -49,7 +49,7 @@ import static org.junit.Assert.assertThat;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(TestConfig.class)
|
||||
@IntegrationTest({"foo=one", "bar=two"})
|
||||
@IntegrationTest({ "foo=one", "bar=two" })
|
||||
public class ConverterBindingTests {
|
||||
|
||||
@Value("${foo:}")
|
||||
@@ -88,11 +88,13 @@ public class ConverterBindingTests {
|
||||
return new GenericConverter() {
|
||||
@Override
|
||||
public Set<ConvertiblePair> getConvertibleTypes() {
|
||||
return Collections.singleton(new ConvertiblePair(String.class, Bar.class));
|
||||
return Collections
|
||||
.singleton(new ConvertiblePair(String.class, Bar.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
public Object convert(Object source, TypeDescriptor sourceType,
|
||||
TypeDescriptor targetType) {
|
||||
return new Bar((String) source);
|
||||
}
|
||||
};
|
||||
@@ -112,6 +114,7 @@ public class ConverterBindingTests {
|
||||
public Foo(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class Bar {
|
||||
@@ -121,6 +124,7 @@ public class ConverterBindingTests {
|
||||
public Bar(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ConfigurationProperties
|
||||
@@ -145,6 +149,7 @@ public class ConverterBindingTests {
|
||||
public void setBar(Bar bar) {
|
||||
this.bar = bar;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user