Enum StackSize

    • Enum Constant Detail

      • SMALL

        public static final StackSize SMALL
        Produces a small stack suitable for finer grained debugging. For performance reasons, this is the only stack size suitable for log statements at level INFO or finer, but is may also be useful for WARNING level log statements in cases where context is not as important. For SEVERE log statements, it is advised to use a stack size of MEDIUM or above.

        Requesting a small stack trace for log statements which occur under normal circumstances is acceptable, but may affect performance. Consider using FloggerApi.withStackTrace(StackSize) in conjunction with rate limiting methods, such as FloggerApi.atMostEvery(int, java.util.concurrent.TimeUnit), to mitigate performance issues.

        The current maximum size of a SMALL stack trace is 10 elements, but this may change.

      • MEDIUM

        public static final StackSize MEDIUM
        Produces a medium sized stack suitable for providing contextual information for most log statements at WARNING or above. There should be enough stack trace elements in a MEDIUM stack to provide sufficient debugging context in most cases.

        Requesting a medium stack trace for any log statements which can occur regularly under normal circumstances is not recommended.

        The current maximum size of a MEDIUM stack trace is 20 elements, but this may change.

      • LARGE

        public static final StackSize LARGE
        Produces a large stack suitable for providing highly detailed contextual information. This is most useful for SEVERE log statements which might be processed by external tools and subject to automated analysis.

        Requesting a large stack trace for any log statement which can occur under normal circumstances is not recommended.

        The current maximum size of a LARGE stack trace is 50 elements, but this may change.

      • FULL

        public static final StackSize FULL
        Provides the complete stack trace. This is included for situations in which it is known that the upper-most elements of the stack are definitely required for analysis.

        Requesting a full stack trace for any log statement which can occur under normal circumstances is not recommended.

      • NONE

        public static final StackSize NONE
        Provides no stack trace, making the withStackTrace() method an effective no-op. This is useful when your stack size is conditional. For example:
         
           logger.atWarning()
               .withStackTrace(showTrace ? StackSize.MEDIUM : StackSize.NONE)
               .log("message");
         
    • Method Detail

      • values

        public static StackSize[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (StackSize c : StackSize.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static StackSize valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null