Commit d1a0d546 by QIANGLU

优化逻辑

parent 45c874a3
......@@ -44,7 +44,7 @@ public class MatrixLogListenerConfiguration {
private void refreshLoggingLevels() {
Set<String> keyNames = config.getPropertyNames();
for (String key : keyNames) {
if (containsIgnoreCase(key, LOGGER_TAG)) {
if (StringUtils.startsWithIgnoreCase(key,LOGGER_TAG)) {
String strLevel = config.getProperty(key, "info");
LogLevel level = LogLevel.valueOf(strLevel.toUpperCase());
loggingSystem.setLogLevel(key.replace(LOGGER_TAG, ""), level);
......@@ -53,17 +53,5 @@ public class MatrixLogListenerConfiguration {
}
}
private static boolean containsIgnoreCase(String str, String searchStr) {
if (StringUtils.isEmpty(str) || StringUtils.isEmpty(searchStr)) {
return false;
}
int len = searchStr.length();
int max = str.length() - len;
for (int i = 0; i <= max; i++) {
if (str.regionMatches(true, i, searchStr, 0, len)) {
return true;
}
}
return false;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment