Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-458

More Multiple Argument Variants for Debug and Trace Statements

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • 2.0.17
    • None
    • None
    • None

    Description

      https://www.slf4j.org/faq.html#logging_performance

      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.

      Please create a 3 and 4 argument variant for debug and trace statements.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            BELUGABEHR DAVID MOLLITOR
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: