[
https://issues.apache.org/jira/browse/LOG4J2-1365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15242917#comment-15242917
]
Mikael Ståldal commented on LOG4J2-1365:
----------------------------------------
For (Reusable)SimpleMessage, I have added this:
{code}
@Override
public int length() {
return charSequence.length();
}
@Override
public char charAt(int index) {
return charSequence.charAt(index);
}
@Override
public CharSequence subSequence(int start, int end) {
return charSequence.subSequence(start, end);
}
{code}
What should the {{charAt(int)}} method do? I don't want to add null check there
since it will be called multiple times.
> Add CharSequenceFormattable interface for Messages to improve performance of
> Layouts
> ------------------------------------------------------------------------------------
>
> Key: LOG4J2-1365
> URL: https://issues.apache.org/jira/browse/LOG4J2-1365
> Project: Log4j 2
> Issue Type: Improvement
> Components: Layouts
> Affects Versions: 2.5
> Reporter: Mikael Ståldal
> Assignee: Mikael Ståldal
> Priority: Minor
>
> {code}
> public interface CharSequenceFormattable {
> CharSequence getFormattedCharSequence();
> }
> {code}
> This can be implemented by Messages where it makes sense and used by Layouts
> where it makes sense.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]