[slf4j-dev] [JIRA] (SLF4J-458) More Multiple Argument Variants for Debug and Trace Statements

QOS.CH (JIRA) noreply-jira at qos.ch
Thu May 16 19:03:00 CEST 2019


    [ https://jira.qos.ch/browse/SLF4J-458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19557#comment-19557 ] 

DAVID MOLLITOR commented on SLF4J-458:
--------------------------------------

Woops.  Thanks.

Adding more arguments will cut down on the number of arrays being created.  Updating should give customers a performance boost.

> More Multiple Argument Variants for Debug and Trace Statements
> --------------------------------------------------------------
>
>                 Key: SLF4J-458
>                 URL: https://jira.qos.ch/browse/SLF4J-458
>             Project: SLF4J
>          Issue Type: Improvement
>            Reporter: DAVID MOLLITOR
>            Assignee: SLF4J developers list
>             Fix For: 2.0
>
>
> [https://www.slf4j.org/faq.html#logging_performance]
> {quote}
> A two argument variant is also available. For example, you can write:
> logger.debug("The new entry is {}. It replaces {}.", entry, oldEntry);
> If three or more arguments need to be passed, you can make use of the Object... variant of the printing methods. For example, you can write:
> logger.debug("Value {} was inserted between {} and {}.", newVal, below, above);
> This form incurs the hidden cost of construction of an Object[] (object array) which is usually very small. The one and two argument variants do not incur this hidden cost and exist solely for this reason (efficiency). The slf4j-api would be smaller/cleaner with only the Object... variant.
> {quote}
> Please create a 3 and 4 argument variant for {{debug}} and {{trace}} statements.



--
This message was sent by Atlassian JIRA
(v7.3.1#73012)


More information about the slf4j-dev mailing list