Class CallerData

java.lang.Object
ch.qos.logback.classic.spi.CallerData

public class CallerData extends Object
This class computes caller data returning the result in the form of a StackTraceElement array.
  • Field Details

    • NA

      public static final String NA
      When caller information is not available this constant is used for file name, method name, etc.
      See Also:
    • LOG4J_CATEGORY

      private static final String LOG4J_CATEGORY
      See Also:
    • SLF4J_BOUNDARY

      private static final String SLF4J_BOUNDARY
      See Also:
    • LINE_NA

      public static final int LINE_NA
      When caller information is not available this constant is used for the line number.
      See Also:
    • CALLER_DATA_NA

      public static final String CALLER_DATA_NA
    • EMPTY_CALLER_DATA_ARRAY

      public static final StackTraceElement[] EMPTY_CALLER_DATA_ARRAY
      This value is returned in case no caller data could be extracted.
  • Constructor Details

    • CallerData

      public CallerData()
  • Method Details

    • extract

      public static StackTraceElement[] extract(Throwable t, String fqnOfInvokingClass, int maxDepth, List<String> frameworkPackageList)
      Extract caller data information as an array based on a Throwable passed as parameter
    • isInFrameworkSpace

      static boolean isInFrameworkSpace(String currentClass, String fqnOfInvokingClass, List<String> frameworkPackageList)
    • isInFrameworkSpaceList

      private static boolean isInFrameworkSpaceList(String currentClass, List<String> frameworkPackageList)
      Is currentClass present in the list of packages considered part of the logging framework?
    • naInstance

      public static StackTraceElement naInstance()
      Returns a StackTraceElement where all string fields are set to NA and line number is set to LINE_NA.
      Returns:
      StackTraceElement with values set to NA constants.
      Since:
      1.0.10