Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
TaiJuWu committed Dec 25, 2024
1 parent 015e80e commit 1234fcc
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,14 @@ private LoggerLevel loggerLevel(org.apache.logging.log4j.Logger logger) {
}

private boolean isValidRootLoggerName(String namespace) {
return VALID_ROOT_LOGGER_NAMES.stream()
.anyMatch(rootLoggerNames -> rootLoggerNames.equalsIgnoreCase(namespace));
boolean result = false;
for (String rootLoggerName : VALID_ROOT_LOGGER_NAMES) {
if (rootLoggerName.equalsIgnoreCase(namespace)) {
result = true;
break;
}
}
return result;
}

/**
Expand All @@ -225,6 +231,6 @@ private boolean isValidRootLoggerName(String namespace) {
* @return The logger name - returns "root" for empty string, otherwise returns the original logger name
*/
private String getLoggerName(org.apache.logging.log4j.Logger logger) {
return logger.getName().equals(LogManager.ROOT_LOGGER_NAME) ? ROOT_LOGGER_NAME : logger.getName();
return logger.getName().equalsIgnoreCase(LogManager.ROOT_LOGGER_NAME) ? ROOT_LOGGER_NAME : logger.getName();
}
}

0 comments on commit 1234fcc

Please sign in to comment.