Class LoggingHelper

java.lang.Object
org.freedesktop.dbus.utils.LoggingHelper

public final class LoggingHelper extends 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
Author:
David M.
  • Method Details

    • arraysDeepString

      public static String arraysDeepString(boolean _loggingEnabled, Object[] _array)
      Calls Arrays.deepToString(Object[]) if given boolean is true, returns null otherwise.
      Parameters:
      _loggingEnabled - true to create deep-string representation of given array
      _array - array to convert to deep-string
      Returns:
      String or null if given boolean is false or _array is null
    • logIf

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