@Implements(value=android.util.Log.class) public class ShadowLog extends java.lang.Object
Modifier and Type | Class and 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 and Description |
---|---|
static java.io.PrintStream |
stream |
Constructor and Description |
---|
ShadowLog() |
Modifier and Type | Method and Description |
---|---|
static void |
clear()
Clear all accumulated logs.
|
protected static int |
d(java.lang.String tag,
java.lang.String msg) |
protected static int |
d(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable throwable) |
protected static int |
e(java.lang.String tag,
java.lang.String msg) |
protected static int |
e(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable throwable) |
static java.util.List<ShadowLog.LogItem> |
getLogs()
Returns ordered list of all log entries.
|
static java.util.List<ShadowLog.LogItem> |
getLogsForTag(java.lang.String tag)
Returns ordered list of all log items for a specific tag.
|
protected static int |
i(java.lang.String tag,
java.lang.String msg) |
protected static int |
i(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable throwable) |
protected static boolean |
isLoggable(java.lang.String tag,
int level) |
protected static int |
println_native(int bufID,
int priority,
java.lang.String tag,
java.lang.String msg) |
static void |
reset() |
static void |
setLoggable(java.lang.String tag,
int level)
Sets the log level of a given tag, that
isLoggable(java.lang.String, int) will follow. |
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(java.lang.String tag,
java.lang.String msg) |
protected static int |
v(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable throwable) |
protected static int |
w(java.lang.String tag,
java.lang.String msg) |
protected static int |
w(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable throwable) |
protected static int |
w(java.lang.String tag,
java.lang.Throwable throwable) |
protected static int |
wtf(java.lang.String tag,
java.lang.String msg) |
protected static int |
wtf(java.lang.String tag,
java.lang.String msg,
java.lang.Throwable throwable) |
@Implementation protected static int e(java.lang.String tag, java.lang.String msg)
@Implementation protected static int e(java.lang.String tag, java.lang.String msg, java.lang.Throwable throwable)
@Implementation protected static int d(java.lang.String tag, java.lang.String msg)
@Implementation protected static int d(java.lang.String tag, java.lang.String msg, java.lang.Throwable throwable)
@Implementation protected static int i(java.lang.String tag, java.lang.String msg)
@Implementation protected static int i(java.lang.String tag, java.lang.String msg, java.lang.Throwable throwable)
@Implementation protected static int v(java.lang.String tag, java.lang.String msg)
@Implementation protected static int v(java.lang.String tag, java.lang.String msg, java.lang.Throwable throwable)
@Implementation protected static int w(java.lang.String tag, java.lang.String msg)
@Implementation protected static int w(java.lang.String tag, java.lang.Throwable throwable)
@Implementation protected static int w(java.lang.String tag, java.lang.String msg, java.lang.Throwable throwable)
@Implementation protected static int wtf(java.lang.String tag, java.lang.String msg)
@Implementation protected static int wtf(java.lang.String tag, java.lang.String msg, java.lang.Throwable throwable)
public static void setWtfIsFatal(boolean fatal)
Sets whether calling Log.wtf(java.lang.String, java.lang.String)
will throw ShadowLog.TerribleFailure
.
@Implementation protected static boolean isLoggable(java.lang.String tag, int level)
@Implementation protected static int println_native(int bufID, int priority, java.lang.String tag, java.lang.String msg)
public static void setLoggable(java.lang.String tag, int level)
Sets the log level of a given tag, that isLoggable(java.lang.String, int)
will follow.
tag
- A log taglevel
- A log level, from Log
public static java.util.List<ShadowLog.LogItem> getLogs()
Returns ordered list of all log entries.
public static java.util.List<ShadowLog.LogItem> getLogsForTag(java.lang.String tag)
Returns ordered list of all log items for a specific tag.
tag
- The tag to get logs forpublic static void clear()
Clear all accumulated logs.
@Resetter public static void reset()
public static void setupLogging()