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

James Perkins (JIRA) jira-events at lists.jboss.org
Fri Apr 27 14:00:19 EDT 2012


     [ https://issues.jboss.org/browse/LOGTOOL-47?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Perkins closed LOGTOOL-47.
--------------------------------


    
> 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
>            Assignee: James Perkins
>
> 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