You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2021/12/17 02:16:14 UTC
[logging-log4j2] 01/03: Less silly variable name.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 61d4c3230cb9021289d0978fcbb528a7ece8e625
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 16 20:27:51 2021 -0500
Less silly variable name.
Conventional formatting of case statement.
---
.../src/main/java/org/apache/log4j/xml/XmlConfiguration.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/xml/XmlConfiguration.java b/log4j-1.2-api/src/main/java/org/apache/log4j/xml/XmlConfiguration.java
index 7020349..3f51153 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/xml/XmlConfiguration.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/xml/XmlConfiguration.java
@@ -651,12 +651,12 @@ public class XmlConfiguration extends Log4j1Configuration {
Method toLevelMethod = clazz.getMethod("toLevel", ONE_STRING_PARAM);
Level pri = (Level) toLevelMethod.invoke(null, priStr);
logger.setLevel(OptionConverter.convertLevel(pri));
- } catch (Exception oops) {
- if (oops instanceof InterruptedException || oops instanceof InterruptedIOException) {
+ } catch (Exception e) {
+ if (e instanceof InterruptedException || e instanceof InterruptedIOException) {
Thread.currentThread().interrupt();
}
LOGGER.error("Could not create level [" + priStr +
- "]. Reported error follows.", oops);
+ "]. Reported error follows.", e);
return;
}
}
@@ -716,7 +716,8 @@ public class XmlConfiguration extends Log4j1Configuration {
forEachElement(element.getChildNodes(), currentElement -> {
switch (currentElement.getTagName()) {
- case CATEGORY: case LOGGER_ELEMENT:
+ case CATEGORY:
+ case LOGGER_ELEMENT:
parseCategory(currentElement);
break;
case ROOT_TAG:
@@ -728,7 +729,8 @@ public class XmlConfiguration extends Log4j1Configuration {
case THROWABLE_RENDERER_TAG:
LOGGER.warn("Throwable Renderers are not supported by Log4j 2 and will be ignored.");
break;
- case CATEGORY_FACTORY_TAG: case LOGGER_FACTORY_TAG:
+ case CATEGORY_FACTORY_TAG:
+ case LOGGER_FACTORY_TAG:
LOGGER.warn("Log4j 1 Logger factories are not supported by Log4j 2 and will be ignored.");
break;
case APPENDER_TAG: