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: