You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2020/03/07 01:50:08 UTC

[GitHub] [logging-log4j2] prasad-acit opened a new pull request #348: LOG4J2-2793 - Unable to parse the log LEVEL when it ends with SPACE.

prasad-acit opened a new pull request #348: LOG4J2-2793 - Unable to parse the log LEVEL when it ends with SPACE.
URL: https://github.com/apache/logging-log4j2/pull/348
 
 
   Handled leading & trailing spaces in log LEVEL.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [logging-log4j2] rgoers commented on a change in pull request #348: LOG4J2-2793 - Unable to parse the log LEVEL when it ends with SPACE.

Posted by GitBox <gi...@apache.org>.
rgoers commented on a change in pull request #348: LOG4J2-2793 - Unable to parse the log LEVEL when it ends with SPACE.
URL: https://github.com/apache/logging-log4j2/pull/348#discussion_r407133516
 
 

 ##########
 File path: log4j-api/src/main/java/org/apache/logging/log4j/Level.java
 ##########
 @@ -312,7 +313,8 @@ private static String toUpperCase(final String name) {
      */
     public static Level valueOf(final String name) {
         Objects.requireNonNull(name, "No level name given.");
-        final String levelName = toUpperCase(name);
+        String trimmedName = name.trim();
+        final String levelName = toUpperCase(trimmedName);
 
 Review comment:
   Why do we need an extra variable? Just
   `final String levelName = toUpperCase(name.trim()));`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [logging-log4j2] rgoers commented on a change in pull request #348: LOG4J2-2793 - Unable to parse the log LEVEL when it ends with SPACE.

Posted by GitBox <gi...@apache.org>.
rgoers commented on a change in pull request #348: LOG4J2-2793 - Unable to parse the log LEVEL when it ends with SPACE.
URL: https://github.com/apache/logging-log4j2/pull/348#discussion_r407133486
 
 

 ##########
 File path: log4j-api/src/main/java/org/apache/logging/log4j/Level.java
 ##########
 @@ -284,7 +284,8 @@ public static Level toLevel(final String name, final Level defaultLevel) {
         if (name == null) {
             return defaultLevel;
         }
-        final Level level = LEVELS.get(toUpperCase(name));
+        String trimmedName = name.trim();
+        final Level level = LEVELS.get(toUpperCase(trimmedName));
 
 Review comment:
   Why do we need an extra variable? Just
   `final Level level = LEVELS.get(toUpperCase(name.trim()));`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [logging-log4j2] rgoers merged pull request #348: LOG4J2-2793 - Unable to parse the log LEVEL when it ends with SPACE.

Posted by GitBox <gi...@apache.org>.
rgoers merged pull request #348: LOG4J2-2793 - Unable to parse the log LEVEL when it ends with SPACE.
URL: https://github.com/apache/logging-log4j2/pull/348
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services