@Implements(android.util.Log.class) public class ShadowLog extends Object
Modifier and Type | Class | Description |
---|---|---|
static class |
ShadowLog.LogItem |
|
static class |
ShadowLog.TerribleFailure |
Failure thrown when wtf_is_fatal is true and Log.wtf is called.
|
Modifier and Type | Field | Description |
---|---|---|
static PrintStream |
stream |
Constructor | Description |
---|---|
ShadowLog() |
Modifier and Type | Method | Description |
---|---|---|
static void |
clear() |
Clear all accumulated logs.
|
protected static int |
d(String tag,
String msg) |
|
protected static int |
d(String tag,
String msg,
Throwable throwable) |
|
protected static int |
e(String tag,
String msg) |
|
protected static int |
e(String tag,
String msg,
Throwable throwable) |
|
static List<ShadowLog.LogItem> |
getLogs() |
Returns ordered list of all log entries.
|
static List<ShadowLog.LogItem> |
getLogsForTag(String tag) |
Returns ordered list of all log items for a specific tag.
|
protected static int |
i(String tag,
String msg) |
|
protected static int |
i(String tag,
String msg,
Throwable throwable) |
|
protected static boolean |
isLoggable(String tag,
int level) |
|
protected static char |
levelToChar(int level) |
|
protected static int |
println_native(int bufID,
int priority,
String tag,
String msg) |
|
static void |
reset() |
|
static void |
setLoggable(String tag,
int level) |
Sets the log level of a given tag, that
isLoggable(java.lang.String, int) will follow. |
static void |
setTimeSupplier(Supplier<String> supplier) |
Sets supplier that can be used to get time to add to logs.
|
static void |
setupLogging() |
|
static void |
setWtfIsFatal(boolean fatal) |
Sets whether calling
Log.wtf(java.lang.String, java.lang.String) will throw ShadowLog.TerribleFailure . |
protected static int |
v(String tag,
String msg) |
|
protected static int |
v(String tag,
String msg,
Throwable throwable) |
|
protected static int |
w(String tag,
String msg) |
|
protected static int |
w(String tag,
String msg,
Throwable throwable) |
|
protected static int |
w(String tag,
Throwable throwable) |
|
protected static int |
wtf(String tag,
String msg) |
|
protected static int |
wtf(String tag,
String msg,
Throwable throwable) |
public static PrintStream stream
@Implementation protected static int e(String tag, String msg)
@Implementation protected static int e(String tag, String msg, Throwable throwable)
@Implementation protected static int d(String tag, String msg)
@Implementation protected static int d(String tag, String msg, Throwable throwable)
@Implementation protected static int i(String tag, String msg)
@Implementation protected static int i(String tag, String msg, Throwable throwable)
@Implementation protected static int v(String tag, String msg)
@Implementation protected static int v(String tag, String msg, Throwable throwable)
@Implementation protected static int w(String tag, String msg)
@Implementation protected static int w(String tag, Throwable throwable)
@Implementation protected static int w(String tag, String msg, Throwable throwable)
@Implementation protected static int wtf(String tag, String msg)
@Implementation protected static int wtf(String tag, String msg, Throwable throwable)
public static void setWtfIsFatal(boolean fatal)
Log.wtf(java.lang.String, java.lang.String)
will throw ShadowLog.TerribleFailure
.public static void setTimeSupplier(Supplier<String> supplier)
@Implementation protected static boolean isLoggable(String tag, int level)
@Implementation protected static int println_native(int bufID, int priority, String tag, String msg)
public static void setLoggable(String tag, int level)
isLoggable(java.lang.String, int)
will follow.tag
- A log taglevel
- A log level, from Log
protected static char levelToChar(int level)
public static List<ShadowLog.LogItem> getLogs()
public static List<ShadowLog.LogItem> getLogsForTag(String tag)
tag
- The tag to get logs forpublic static void clear()
@Resetter public static void reset()
public static void setupLogging()