Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye authored and wilkinsona committed Jul 28, 2023
1 parent 3f2c583 commit 5a205db
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public String getConfiguredLevel() {
*/
public static class GroupLoggerLevels extends LoggerLevels {

private List<String> members;
private final List<String> members;

public GroupLoggerLevels(LogLevel configuredLevel, List<String> members) {
super(configuredLevel);
Expand All @@ -165,7 +165,7 @@ public List<String> getMembers() {
}

/**
* Levels configured for single logger group exposed in a JSON friendly way.
* Levels configured for single logger exposed in a JSON friendly way.
*/
public static class SingleLoggerLevels extends LoggerLevels {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* <p>
* To accommodate the differences, we use {@code org.gradle.util.internal.ConfigureUtil}
* with Gradle 7.1 and later. With earlier versions, {@code org.gradle.util.ConfigureUtil}
* is used. This avoids users by nagged about deprecated API usage in our plugin.
* is used. This avoids users to be nagged about deprecated API usage in our plugin.
*
* @author Andy Wilkinson
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public LoggerConfiguration(String name, LogLevel configuredLevel, LogLevel effec
public LoggerConfiguration(String name, LevelConfiguration levelConfiguration,
LevelConfiguration inheritedLevelConfiguration) {
Assert.notNull(name, "Name must not be null");
Assert.notNull(inheritedLevelConfiguration, "EffectiveLevelConfiguration must not be null");
Assert.notNull(inheritedLevelConfiguration, "InheritedLevelConfiguration must not be null");
this.name = name;
this.levelConfiguration = levelConfiguration;
this.inheritedLevelConfiguration = inheritedLevelConfiguration;
Expand Down Expand Up @@ -140,15 +140,15 @@ public String toString() {
}

/**
* Supported logger configurations scopes.
* Supported logger configuration scopes.
*
* @since 2.7.13
*/
public enum ConfigurationScope {

/**
* Only return configuration that has been applied directly applied. Often
* referred to as 'configured' or 'assigned' configuration.
* Only return configuration that has been applied directly. Often referred to as
* 'configured' or 'assigned' configuration.
*/
DIRECT,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.springframework.boot.testsupport.classpath.ClassPathOverrides;

/**
* Tests for {@link YamlPropertySourceLoader} with SnakeYAML 1.33.
* Tests for {@link YamlPropertySourceLoader} with SnakeYAML 1.32.
*
* @author Andy Wilkinson
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ void createWithLevelConfigurationWhenNameIsNullThrowsException() {
}

@Test
void createWithLevelConfigurationWhenEffectiveLevelIsNullThrowsException() {
void createWithLevelConfigurationWhenInheritedLevelConfigurationIsNullThrowsException() {
assertThatIllegalArgumentException()
.isThrownBy(() -> new LoggerConfiguration("test", null, (LevelConfiguration) null))
.withMessage("EffectiveLevelConfiguration must not be null");
.withMessage("InheritedLevelConfiguration must not be null");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void setLevelToNull(CapturedOutput output) {
}

@Test
void getLoggingConfigurations() {
void getLoggerConfigurations() {
this.loggingSystem.beforeInitialize();
this.loggingSystem.initialize(null, null, null);
this.loggingSystem.setLogLevel(getClass().getName(), LogLevel.DEBUG);
Expand All @@ -176,7 +176,7 @@ void getLoggingConfigurations() {
}

@Test
void getLoggingConfiguration() {
void getLoggerConfiguration() {
this.loggingSystem.beforeInitialize();
this.loggingSystem.initialize(null, null, null);
this.loggingSystem.setLogLevel(getClass().getName(), LogLevel.DEBUG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void setLevelToNull(CapturedOutput output) {
}

@Test
void getLoggingConfigurations() {
void getLoggerConfigurations() {
this.loggingSystem.beforeInitialize();
this.loggingSystem.initialize(this.initializationContext, null, null);
this.loggingSystem.setLogLevel(getClass().getName(), LogLevel.DEBUG);
Expand All @@ -191,7 +191,7 @@ void getLoggingConfigurations() {
}

@Test
void getLoggingConfigurationsShouldReturnAllLoggers() {
void getLoggerConfigurationsShouldReturnAllLoggers() {
LogManager.getLogger("org.springframework.boot.logging.log4j2.Log4J2LoggingSystemTests$Nested");
this.loggingSystem.beforeInitialize();
this.loggingSystem.initialize(this.initializationContext, null, null);
Expand All @@ -208,7 +208,7 @@ void getLoggingConfigurationsShouldReturnAllLoggers() {
}

@Test // gh-35227
void getLoggingConfigurationsWhenHasCustomLevel() {
void getLoggerConfigurationWhenHasCustomLevel() {
this.loggingSystem.beforeInitialize();
this.loggingSystem.initialize(this.initializationContext, null, null);
LoggerContext loggerContext = (LoggerContext) LogManager.getContext(false);
Expand All @@ -225,7 +225,7 @@ private void assertIsPresent(String loggerName, Map<String, LogLevel> loggers, L
}

@Test
void getLoggingConfiguration() {
void getLoggerConfiguration() {
this.loggingSystem.beforeInitialize();
this.loggingSystem.initialize(this.initializationContext, null, null);
this.loggingSystem.setLogLevel(getClass().getName(), LogLevel.DEBUG);
Expand All @@ -235,7 +235,7 @@ void getLoggingConfiguration() {
}

@Test
void getLoggingConfigurationShouldReturnLoggerWithNullConfiguredLevel() {
void getLoggerConfigurationShouldReturnLoggerWithNullConfiguredLevel() {
this.loggingSystem.beforeInitialize();
this.loggingSystem.initialize(this.initializationContext, null, null);
this.loggingSystem.setLogLevel(getClass().getName(), LogLevel.DEBUG);
Expand All @@ -244,7 +244,7 @@ void getLoggingConfigurationShouldReturnLoggerWithNullConfiguredLevel() {
}

@Test
void getLoggingConfigurationForNonExistentLoggerShouldReturnNull() {
void getLoggerConfigurationForNonExistentLoggerShouldReturnNull() {
this.loggingSystem.beforeInitialize();
this.loggingSystem.initialize(this.initializationContext, null, null);
this.loggingSystem.setLogLevel(getClass().getName(), LogLevel.DEBUG);
Expand Down Expand Up @@ -367,7 +367,7 @@ void initializationIsOnlyPerformedOnceUntilCleanedUp() {
}

@Test
void getLoggingConfigurationWithResetLevelReturnsNull() {
void getLoggerConfigurationWithResetLevelReturnsNull() {
this.loggingSystem.beforeInitialize();
this.loggingSystem.initialize(this.initializationContext, null, null);
this.loggingSystem.setLogLevel("com.example", LogLevel.WARN);
Expand All @@ -381,7 +381,7 @@ void getLoggingConfigurationWithResetLevelReturnsNull() {
}

@Test
void getLoggingConfigurationWithResetLevelWhenAlreadyConfiguredReturnsParentConfiguredLevel() {
void getLoggerConfigurationWithResetLevelWhenAlreadyConfiguredReturnsParentConfiguredLevel() {
LoggerContext loggerContext = (LoggerContext) LogManager.getContext(false);
this.loggingSystem.beforeInitialize();
this.loggingSystem.initialize(this.initializationContext, null, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void setLevelToNull(CapturedOutput output) {
}

@Test
void getLoggingConfigurations() {
void getLoggerConfigurations() {
this.loggingSystem.beforeInitialize();
initialize(this.initializationContext, null, null);
this.loggingSystem.setLogLevel(getClass().getName(), LogLevel.DEBUG);
Expand All @@ -223,7 +223,7 @@ void getLoggingConfigurations() {
}

@Test
void getLoggingConfiguration() {
void getLoggerConfiguration() {
this.loggingSystem.beforeInitialize();
initialize(this.initializationContext, null, null);
this.loggingSystem.setLogLevel(getClass().getName(), LogLevel.DEBUG);
Expand All @@ -233,15 +233,15 @@ void getLoggingConfiguration() {
}

@Test
void getLoggingConfigurationForLoggerThatDoesNotExistShouldReturnNull() {
void getLoggerConfigurationForLoggerThatDoesNotExistShouldReturnNull() {
this.loggingSystem.beforeInitialize();
initialize(this.initializationContext, null, null);
LoggerConfiguration configuration = this.loggingSystem.getLoggerConfiguration("doesnotexist");
assertThat(configuration).isNull();
}

@Test
void getLoggingConfigurationForALL() {
void getLoggerConfigurationForALL() {
this.loggingSystem.beforeInitialize();
initialize(this.initializationContext, null, null);
Logger logger = (Logger) StaticLoggerBinder.getSingleton().getLoggerFactory().getLogger(getClass().getName());
Expand Down

0 comments on commit 5a205db

Please sign in to comment.