Top Description Constructors Methods
org.freedesktop.dbus.utils

public final Class LoggingHelper

extends Object
Class Inheritance
Imports
java.util.*

Helper for some logging stuff, e.g. avoid call Arrays#deepToString(Object[]) if loglevel is not enabled.
Author
David M.
Since
v3.2.4 - 2020-08-24

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

String or null if input null
arraysVeryDeepString
(Object[]
array to convert
_array
)

Creates a toString() result for an array.

private static List<String>

Returns:

List of String, null if input null
arraysVeryDeepStringRecursive
(Object[]
array to convert
_array
)

Creates a toString() result for an array.

pack-priv static String

Returns:

String or null if input was null
convertToString
(Object
object to convert
_obj
)

Converts an object to String and handles primitive array types.

public static void
logIf(boolean
boolean, if true runnable is executed
_enabled
,
Runnable
runnable containing logger call
_loggerCall
)

Executes the runnable if the boolean is true.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LoggingHelperback to summary
private LoggingHelper()

Method Detail

arraysVeryDeepStringback to summary
public static String arraysVeryDeepString(Object[] _array)

Creates a toString() result for an array. Will resolve nested arrays and collections.

Parameters
_array:Object[]

array to convert

Returns:String

String or null if input null

Since
v4.2.2 - 2023-01-20
arraysVeryDeepStringRecursiveback to summary
private static List<String> arraysVeryDeepStringRecursive(Object[] _array)

Creates a toString() result for an array. Will resolve nested arrays and collections.

Parameters
_array:Object[]

array to convert

Returns:List<String>

List of String, null if input null

Since
v4.2.2 - 2023-01-20
convertToStringback to summary
pack-priv static String convertToString(Object _obj)

Converts an object to String and handles primitive array types.

Parameters
_obj:Object

object to convert

Returns:String

String or null if input was null

logIfback to summary
public static void logIf(boolean _enabled, Runnable _loggerCall)

Executes the runnable if the boolean is true.

Parameters
_enabled:boolean

boolean, if true runnable is executed

_loggerCall:Runnable

runnable containing logger call