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

[ https://jira.qos.ch/browse/SLF4J-458?page=com.atlassian.jira.plugin.system.i... ] 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)
participants (1)
-
QOS.CH (JIRA)