public class DebugLogger
extends java.lang.Object
t will ensure that when your ready to dump all the logs, they will be returned in the order they were provided. Since these are not outputted to the actual log stream, make sure any logging relevant to the issue is captured by this utility.
This utility has several deficiencies, the largest of which is using System.nanoTime()
for log ordering. Since nanosecond time can roll over from positive to negative, in those rare
situations log ordering may be incorrect. It is design only as a debugging aid and should
NEVER be included after debugging is completed.
Constructor and Description |
---|
DebugLogger() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getAllStoredMessages()
Request to get and clear all currently stored log messages.
|
static java.lang.String |
getAllStoredMessages(boolean includeLogTimes)
Request to get and clear all currently stored log messages.
|
static int |
getCurrentMessageQty()
This call checks how many messages are waiting in the stored map.
|
static java.lang.String |
getOldestLogMessages(int qty)
This call retrieves and removes the oldest stored log messages.
|
static java.lang.String |
getOldestLogMessages(int qty,
boolean includeLogTimes)
This call retrieves and removes the oldest stored log messages.
|
static void |
log(java.lang.String msg)
This adds a log message to the stored log.
|
public static void log(java.lang.String msg)
getAllStoredMessages()
is called.msg
- message to be stored into log mappublic static int getCurrentMessageQty()
public static java.lang.String getAllStoredMessages()
This calls getAllStoredMessages(boolean)
with a default of NOT including the time in
nanoseconds.
public static java.lang.String getAllStoredMessages(boolean includeLogTimes)
includeLogTimes
- boolean to include time in nanoseconds that log message was recordedpublic static java.lang.String getOldestLogMessages(int qty)
getAllStoredMessages()
.
This calls getOldestLogMessages(int, boolean)
with a default of NOT including the
time in nanoseconds.
qty
- maximum quantity of messages to retrievepublic static java.lang.String getOldestLogMessages(int qty, boolean includeLogTimes)
getAllStoredMessages()
.qty
- maximum quantity of messages to retrieveincludeLogTimes
- boolean to include time in nanoseconds that log message was recorded