Package org.debugtrace
Class DebugTrace
java.lang.Object
org.debugtrace.DebugTrace
Contains the main static methods of DebugTrace.
- Since:
- 1.0.0
- Author:
- Masato Kokubo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static int
protected static String
protected static int
protected static String
protected static String
protected static String
protected static String
protected static String
protected static String
protected static String
protected static String
protected static String
protected static String
protected static String
protected static String
protected static String
protected static String
protected static String
protected static int
protected static int
protected static int
protected static String
protected static String
protected static String
protected static String
protected static int
protected static String
protected static String
protected static int
protected static String
protected static String
protected static String
protected static String
protected static String
protected static String
static final String
DebugTrace version stringprotected static String
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
appendTimestamp
(String string) Append a timestamp to the head of the string.
This method is used internally.static void
enter()
Call this method at entrance of your methods.static String
Returns the last log string output.static void
Initializes this class.static void
Initializes this class.static boolean
Returns whether tracing is enabled.static void
leave()
Call this method at exit of your methods.static String
Outputs the message to the log.static boolean
Outputs the name and the boolean value to the log.static boolean
print
(String name, boolean value, LogOptions logOptions) Outputs the name and the boolean value to the log.static byte
Outputs the name and the byte value to the log.static byte
print
(String name, byte value, LogOptions logOptions) Outputs the name and the byte value to the log.static char
Outputs the name and the char value to the log.static char
print
(String name, char value, LogOptions logOptions) Outputs the name and the char value to the log.static double
Outputs the name and the value to the log.static double
print
(String name, double value, LogOptions logOptions) Outputs the name and the value to the log.static float
Outputs the name and the value to the log.static float
print
(String name, float value, LogOptions logOptions) Outputs the name and the value to the log.static int
Outputs the name and the int value to the log.static int
print
(String name, int value, LogOptions logOptions) Outputs the name and the int value to the log.static long
Outputs the name and the long value to the log.static long
print
(String name, long value, LogOptions logOptions) Outputs the name and the long value to the log.static short
Outputs the name and the short value to the log.static short
print
(String name, short value, LogOptions logOptions) Outputs the name and the short value to the log.static boolean
print
(String name, BooleanSupplier valueSupplier) Outputs the name and the boolean value to the log.static boolean
print
(String name, BooleanSupplier valueSupplier, LogOptions logOptions) Outputs the name and the boolean value to the log.static double
print
(String name, DoubleSupplier valueSupplier) Outputs the name and the double value to the log.static double
print
(String name, DoubleSupplier valueSupplier, LogOptions logOptions) Outputs the name and the double value to the log.static int
print
(String name, IntSupplier valueSupplier) Outputs the name and the int value to the log.static int
print
(String name, IntSupplier valueSupplier, LogOptions logOptions) Outputs the name and the int value to the log.static long
print
(String name, LongSupplier valueSupplier) Outputs the name and the long value to the log.static long
print
(String name, LongSupplier valueSupplier, LogOptions logOptions) Outputs the name and the long value to the log.static <T> T
Outputs the name and the value to the log.static <T> T
print
(String name, Supplier<T> valueSupplier, LogOptions logOptions) Outputs the name and the value to the log.static <T> T
Outputs the name and the value to the log.static <T> T
print
(String name, T value, LogOptions logOptions) Outputs the name and the value to the log.static String
Outputs a message to the log.static void
printStack
(int maxCount) Outputs a list of StackTraceElements to the log.
-
Field Details
-
VERSION
DebugTrace version string- Since:
- 3.0.0
- See Also:
-
enterFormat
-
leaveFormat
-
threadBoundaryFormat
-
classBoundaryFormat
-
indentString
-
dataIndentString
-
limitString
-
nonOutputString
-
cyclicReferenceString
-
varNameValueSeparator
-
keyValueSeparator
-
printSuffixFormat
-
sizeFormat
-
minimumOutputSize
protected static int minimumOutputSize -
lengthFormat
-
minimumOutputLength
protected static int minimumOutputLength -
utilDateFormat
-
sqlDateFormat
-
timeFormat
-
timestampFormat
-
localDateFormat
-
localTimeFormat
-
offsetTimeFormat
-
localDateTimeFormat
-
offsetDateTimeFormat
-
zonedDateTimeFormat
-
instantFormat
-
logDateTimeFormat
-
timeZone
-
maximumDataOutputWidth
protected static int maximumDataOutputWidth -
collectionLimit
protected static int collectionLimit -
byteArrayLimit
protected static int byteArrayLimit -
stringLimit
protected static int stringLimit -
reflectionNestLimit
protected static int reflectionNestLimit -
nonOutputProperties
-
defaultPackage
-
defaultPackageString
-
reflectionClassPaths
-
reflectionClasses
-
nonReflectionClasses
-
mapNameMap
-
-
Method Details
-
initClass
public static void initClass()Initializes this class.- Since:
- 3.0.0
-
initClass
Initializes this class.- Parameters:
baseName
- the base name of the resource properties file- Since:
- 3.0.0
-
appendTimestamp
Append a timestamp to the head of the string.
This method is used internally.- Parameters:
string
- a string- Returns:
- a string appended a timestamp string
-
isEnabled
public static boolean isEnabled()Returns whether tracing is enabled.- Returns:
- true if tracing is enabled; false otherwise
-
enter
public static void enter()Call this method at entrance of your methods. -
leave
public static void leave()Call this method at exit of your methods. -
print
Outputs the message to the log.- Parameters:
message
- a message- Returns:
- the message
-
print
Outputs a message to the log.- Parameters:
messageSupplier
- a message supplier- Returns:
- the message if isEnabled(), otherwise null
-
print
Outputs the name and the boolean value to the log.- Parameters:
name
- the name of the valuevalue
- the boolean value to output- Returns:
- the value
-
print
Outputs the name and the boolean value to the log.- Parameters:
name
- the name of the valuevalue
- the boolean value to outputlogOptions
- LogOptions- Returns:
- the value
- Since:
- 3.7.0
-
print
Outputs the name and the char value to the log.- Parameters:
name
- the name of the valuevalue
- the char value to output- Returns:
- the value
-
print
Outputs the name and the char value to the log.- Parameters:
name
- the name of the valuevalue
- the char value to outputlogOptions
- LogOptions- Returns:
- the value
- Since:
- 3.7.0
-
print
Outputs the name and the byte value to the log.- Parameters:
name
- the name of the valuevalue
- the byte value to output- Returns:
- the value
-
print
Outputs the name and the byte value to the log.- Parameters:
name
- the name of the valuevalue
- the byte value to outputlogOptions
- LogOptions- Returns:
- the value
- Since:
- 3.7.0
-
print
Outputs the name and the short value to the log.- Parameters:
name
- the name of the valuevalue
- the short value to output- Returns:
- the value
-
print
Outputs the name and the short value to the log.- Parameters:
name
- the name of the valuevalue
- the short value to outputlogOptions
- LogOptions- Returns:
- the value
- Since:
- 3.7.0
-
print
Outputs the name and the int value to the log.- Parameters:
name
- the name of the valuevalue
- the int value to output- Returns:
- the value
-
print
Outputs the name and the int value to the log.- Parameters:
name
- the name of the valuevalue
- the int value to outputlogOptions
- LogOptions- Returns:
- the value
- Since:
- 3.7.0
-
print
Outputs the name and the long value to the log.- Parameters:
name
- the name of the valuevalue
- the long value to output- Returns:
- the value
-
print
Outputs the name and the long value to the log.- Parameters:
name
- the name of the valuevalue
- the long value to outputlogOptions
- LogOptions- Returns:
- the value
- Since:
- 3.7.0
-
print
Outputs the name and the value to the log.- Parameters:
name
- the name of the valuevalue
- the float value to output- Returns:
- the value
-
print
Outputs the name and the value to the log.- Parameters:
name
- the name of the valuevalue
- the float value to outputlogOptions
- LogOptions- Returns:
- the value
- Since:
- 3.7.0
-
print
Outputs the name and the value to the log.- Parameters:
name
- the name of the valuevalue
- the double value to output- Returns:
- the value
-
print
Outputs the name and the value to the log.- Parameters:
name
- the name of the valuevalue
- the double value to outputlogOptions
- LogOptions- Returns:
- the value
- Since:
- 3.7.0
-
print
Outputs the name and the value to the log.- Type Parameters:
T
- the type of the value- Parameters:
name
- the name of the valuevalue
- the value to output (accept null)- Returns:
- the value
-
print
Outputs the name and the value to the log.- Type Parameters:
T
- the type of the value- Parameters:
name
- the name of the valuevalue
- the value to output (accept null)logOptions
- LogOptions- Returns:
- the value
- Since:
- 3.7.0
-
print
Outputs the name and the boolean value to the log.- Parameters:
name
- the name of the valuevalueSupplier
- the supplier of boolean value to output- Returns:
- the value if isEnabled(), otherwise false
-
print
Outputs the name and the boolean value to the log.- Parameters:
name
- the name of the valuevalueSupplier
- the supplier of boolean value to outputlogOptions
- LogOptions- Returns:
- the value if isEnabled(), otherwise false
- Since:
- 3.7.0
-
print
Outputs the name and the int value to the log.- Parameters:
name
- the name of the valuevalueSupplier
- the supplier of int value to output- Returns:
- the value if isEnabled(), otherwise 0
-
print
Outputs the name and the int value to the log.- Parameters:
name
- the name of the valuevalueSupplier
- the supplier of int value to outputlogOptions
- LogOptions- Returns:
- the value if isEnabled(), otherwise 0
- Since:
- 3.7.0
-
print
Outputs the name and the long value to the log.- Parameters:
name
- the name of the valuevalueSupplier
- the supplier of long value to output- Returns:
- the value if isEnabled(), otherwise 0L
-
print
Outputs the name and the long value to the log.- Parameters:
name
- the name of the valuevalueSupplier
- the supplier of long value to outputlogOptions
- LogOptions- Returns:
- the value if isEnabled(), otherwise 0L
- Since:
- 3.7.0
-
print
Outputs the name and the double value to the log.- Parameters:
name
- the name of the valuevalueSupplier
- the supplier of double value to output- Returns:
- the value if isEnabled(), otherwise 0.0
-
print
Outputs the name and the double value to the log.- Parameters:
name
- the name of the valuevalueSupplier
- the supplier of double value to outputlogOptions
- LogOptions- Returns:
- the value if isEnabled(), otherwise 0.0
- Since:
- 3.7.0
-
print
Outputs the name and the value to the log.- Type Parameters:
T
- the type of the value- Parameters:
name
- the name of the valuevalueSupplier
- the supplier of value to output- Returns:
- the value if isEnabled(), otherwise null
-
print
Outputs the name and the value to the log.- Type Parameters:
T
- the type of the value- Parameters:
name
- the name of the valuevalueSupplier
- the supplier of value to outputlogOptions
- LogOptions- Returns:
- the value if isEnabled(), otherwise null
- Since:
- 3.7.0
-
printStack
public static void printStack(int maxCount) Outputs a list of StackTraceElements to the log.- Parameters:
maxCount
- maximum number of stack trace elements to output
-
getLastLog
Returns the last log string output.- Returns:
- the last log string output.
- Since:
- 2.4.0
-