Class NormalizedParameters

java.lang.Object
org.slf4j.helpers.NormalizedParameters

public class NormalizedParameters extends Object
Holds normalized call parameters. Includes utility methods such as normalize(String, Object[], Throwable) to help the normalization of parameters.
Since:
2.0
Author:
ceki
  • Constructor Details

    • NormalizedParameters

      public NormalizedParameters(String message, Object[] arguments, Throwable throwable)
    • NormalizedParameters

      public NormalizedParameters(String message, Object[] arguments)
  • Method Details

    • getMessage

      public String getMessage()
    • getArguments

      public Object[] getArguments()
    • getThrowable

      public Throwable getThrowable()
    • getThrowableCandidate

      public static Throwable getThrowableCandidate(Object[] argArray)
      Helper method to determine if an Object array contains a Throwable as last element
      Parameters:
      argArray - The arguments off which we want to know if it contains a Throwable as last element
      Returns:
      if the last Object in argArray is a Throwable this method will return it, otherwise it returns null
    • trimmedCopy

      public static Object[] trimmedCopy(Object[] argArray)
      Helper method to get all but the last element of an array
      Parameters:
      argArray - The arguments from which we want to remove the last element
      Returns:
      a copy of the array without the last element
    • normalize

      public static NormalizedParameters normalize(String msg, Object[] arguments, Throwable t)
      This method serves to normalize logging call invocation parameters. More specifically, if a throwable argument is not supplied directly, it attempts to extract it from the argument array.
    • normalize

      public static NormalizedParameters normalize(LoggingEvent event)