@Implements(value=android.util.Log.class) public class ShadowLog extends 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 PrintStream |
stream |
Constructor and Description |
---|
ShadowLog() |
Modifier and Type | Method and 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 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 |
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)
Sets whether calling Log.wtf(java.lang.String, java.lang.String)
will throw ShadowLog.TerribleFailure
.
@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)
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 List<ShadowLog.LogItem> getLogs()
Returns ordered list of all log entries.
public static List<ShadowLog.LogItem> getLogsForTag(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()