[JIRA] (SLF4J-416) Format string parameter substitution not working for single exception argument

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[JIRA] (SLF4J-416) Format string parameter substitution not working for single exception argument

JIRA noreply-jira@qos.ch
Stefan Podkowinski created SLF4J-416:
----------------------------------------

             Summary: Format string parameter substitution not working for single exception argument
                 Key: SLF4J-416
                 URL: https://jira.qos.ch/browse/SLF4J-416
             Project: SLF4J
          Issue Type: Bug
          Components: Core API
    Affects Versions: 1.7.25
            Reporter: Stefan Podkowinski
            Assignee: SLF4J developers list


Some logging statements will not work as intended after upgrading to 1.7.25, due to a change in the way exceptions are handled in {{MessageFormatter}}. The following test will illustrate the issue:
 
{code:java}
@Test
public void testExceptionAsParameter() {
  Exception e = new Exception("A terrible mistake");
  result = MessageFormatter.format("Error! {}", e).getMessage();
  assertEquals("Error! A terrible mistake", result);
}
{code}

Result:
{noformat}
org.junit.ComparisonFailure:
 Expected :Error! A terrible mistake
 Actual :Error! {}
{noformat}


This seems to be a regression of SLF4J-353.





--
This message was sent by Atlassian JIRA
(v7.3.1#73012)
_______________________________________________
slf4j-dev mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/slf4j-dev
Loading...