Class LoggingHelper


  • public final class LoggingHelper
    extends java.lang.Object
    Helper for some logging stuff, e.g. avoid call Arrays.deepToString(Object[]) if loglevel is not enabled.
    Since:
    v3.2.4 - 2020-08-24
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private LoggingHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String arraysVeryDeepString​(java.lang.Object[] _array)
      Creates a toString() result for an array.
      private static java.util.List<java.lang.String> arraysVeryDeepStringRecursive​(java.lang.Object[] _array)
      Creates a toString() result for an array.
      static void logIf​(boolean _enabled, java.lang.Runnable _loggerCall)
      Executes the runnable if the boolean is true.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LoggingHelper

        private LoggingHelper()
    • Method Detail

      • arraysVeryDeepString

        public static java.lang.String arraysVeryDeepString​(java.lang.Object[] _array)
        Creates a toString() result for an array. Will resolve nested arrays and collections.
        Parameters:
        _array - array to convert
        Returns:
        String or null if input null
        Since:
        v4.2.2 - 2023-01-20
      • arraysVeryDeepStringRecursive

        private static java.util.List<java.lang.String> arraysVeryDeepStringRecursive​(java.lang.Object[] _array)
        Creates a toString() result for an array. Will resolve nested arrays and collections.
        Parameters:
        _array - array to convert
        Returns:
        List of String, null if input null
        Since:
        v4.2.2 - 2023-01-20
      • logIf

        public static void logIf​(boolean _enabled,
                                 java.lang.Runnable _loggerCall)
        Executes the runnable if the boolean is true.
        Parameters:
        _enabled - boolean, if true runnable is executed
        _loggerCall - runnable containing logger call