[jboss-jira] [JBoss JIRA] (LOGTOOL-47) Add custom stringifier option

David Lloyd (JIRA) jira-events at lists.jboss.org
Wed Apr 25 10:29:17 EDT 2012


David Lloyd created LOGTOOL-47:
----------------------------------

             Summary: Add custom stringifier option
                 Key: LOGTOOL-47
                 URL: https://issues.jboss.org/browse/LOGTOOL-47
             Project: Log Tool
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
            Reporter: David Lloyd
             Fix For: 1.1.0.Beta1


Sometimes the default toString is no good for formatting an argument.  We could introduce an interface into jboss-logging:

{code}
public interface Stringifier {
    String toString(Object object);
}
{code}

Then we could introduce the following annotation:

{code}
@Retention(SOURCE)
@Target(PARAMETER)
public @interface FormatWith {
    Class<? extends Stringifier> value();
}
{code}

Parameters so annotated will be formatted using an instance (singleton, pre-instantiated with the logger instance) of the stringifier.  Because of the method call overhead, such methods would require an explicit level check in the generated code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list