public final class DebugLogger extends java.lang.Object implements SweetLogger
DebugLogger()
, DebugLogger(int)
, and DebugLogger(int, boolean)
.Modifier and Type | Class and Description |
---|---|
static interface |
DebugLogger.LogEvent |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_SIZE |
Constructor and Description |
---|
DebugLogger()
Default constructor which sets the max log size of
DEFAULT_MAX_SIZE . |
DebugLogger(int maxLogSize)
Constructor which allows you to set a custom max log count size.
|
DebugLogger(int maxLogSize,
boolean printToLogCat)
Constructor which allows you to set a custom max log count size, and whether or not you want the logger to print to log cat.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getLastLog()
Returns the last log statement
|
java.util.List<java.lang.String> |
getLastLogs(int count)
Return a
List with the last count of log statements. |
java.lang.String |
getLogList_prettyString()
This is a convenience method which calls
getLogList() , then runs it through Utils_String.prettyFormatLogList(List) . |
java.util.List<java.lang.String> |
getLogList()
Returns a
List of log statements. |
static java.lang.String |
level(int level) |
void |
onLogEntry(int level,
java.lang.String tag,
java.lang.String msg) |
void |
setLogListener(DebugLogger.LogEvent logListener) |
public static final int DEFAULT_MAX_SIZE
public DebugLogger()
DEFAULT_MAX_SIZE
.public DebugLogger(int maxLogSize)
public DebugLogger(int maxLogSize, boolean printToLogCat)
BleManagerConfig.loggingOptions
set to LogOptions.ON
, or LogOptions.ALL_ON
.public final void onLogEntry(int level, java.lang.String tag, java.lang.String msg)
onLogEntry
in interface SweetLogger
public final java.util.List<java.lang.String> getLastLogs(int count)
List
with the last count of log statements. If there haven't been any yet, an empty list is returned.public final java.lang.String getLastLog()
public final java.util.List<java.lang.String> getLogList()
List
of log statements. The default max size is DEFAULT_MAX_SIZE
, but can also be set
by using the DebugLogger(int)
constructor.public final java.lang.String getLogList_prettyString()
getLogList()
, then runs it through Utils_String.prettyFormatLogList(List)
.public static java.lang.String level(int level)
public void setLogListener(DebugLogger.LogEvent logListener)