You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by "Oleg Zhurakousky (JIRA)" <ji...@apache.org> on 2016/04/05 19:36:25 UTC

[jira] [Created] (NIFI-1731) CapturingLogger mishandles formatted messages

Oleg Zhurakousky created NIFI-1731:
--------------------------------------

             Summary: CapturingLogger mishandles formatted messages
                 Key: NIFI-1731
                 URL: https://issues.apache.org/jira/browse/NIFI-1731
             Project: Apache NiFi
          Issue Type: Bug
            Reporter: Oleg Zhurakousky
            Assignee: Oleg Zhurakousky
            Priority: Minor
             Fix For: 0.7.0


Here is the example of such mishandling
{code}
public void warn(String format, Object arg) {
        warnMessages.add(new LogMessage(null, format, null, arg));
        logger.warn(format, arg);
}
{code}
where it really has to be 
{code}
public void warn(String format, Object arg) {
        Object[] args = new Object[] { arg };
        warnMessages.add(new LogMessage(null, MessageFormatter.arrayFormat(format, args).getMessage(), null, args));
        logger.warn(format, arg); 
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)