[jboss-jira] [JBoss JIRA] (LOGTOOL-47) Add custom stringifier option
David Lloyd (JIRA)
jira-events at lists.jboss.org
Wed Apr 25 11:43:26 EDT 2012
[ https://issues.jboss.org/browse/LOGTOOL-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12687691#comment-12687691 ]
David Lloyd commented on LOGTOOL-47:
------------------------------------
Okay, then I guess this is already done :)
> 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
> 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