Package android.util
Class Log
- java.lang.Object
-
- android.util.Log
-
public final class Log extends java.lang.ObjectMock Log implementation for testing on non android host.
-
-
Field Summary
Fields Modifier and Type Field Description static intASSERTPriority constant for the println method.static intDEBUGPriority constant for the println method; use Log.d.static intERRORPriority constant for the println method; use Log.e.static intINFOPriority constant for the println method; use Log.i.static intLOG_ID_CRASHstatic intLOG_ID_EVENTSstatic intLOG_ID_MAINstatic intLOG_ID_RADIOstatic intLOG_ID_SYSTEMstatic intVERBOSEPriority constant for the println method; use Log.v.static intWARNPriority constant for the println method; use Log.w.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intd(java.lang.String tag, java.lang.String msg)Send aDEBUGlog message.static intd(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)Send aDEBUGlog message and log the exception.static inte(java.lang.String tag, java.lang.String msg)Send anERRORlog message.static inte(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)Send aERRORlog message and log the exception.static java.lang.StringgetStackTraceString(java.lang.Throwable tr)Handy function to get a loggable stack trace from a Throwablestatic inti(java.lang.String tag, java.lang.String msg)Send anINFOlog message.static inti(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)Send aINFOlog message and log the exception.static booleanisLoggable(java.lang.String var0, int var1)static intprintln(int bufID, int priority, java.lang.String tag, java.lang.String msg)static intprintln(int priority, java.lang.String tag, java.lang.String msg)Low-level logging call.static intv(java.lang.String tag, java.lang.String msg)Send aVERBOSElog message.static intv(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)Send aVERBOSElog message and log the exception.static intw(java.lang.String tag, java.lang.String msg)Send aWARNlog message.static intw(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)Send aWARNlog message and log the exception.static intw(java.lang.String tag, java.lang.Throwable tr)static intwtf(java.lang.String tag, java.lang.String msg)static intwtf(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)static intwtf(java.lang.String tag, java.lang.Throwable tr)
-
-
-
Field Detail
-
VERBOSE
public static final int VERBOSE
Priority constant for the println method; use Log.v.- See Also:
- Constant Field Values
-
DEBUG
public static final int DEBUG
Priority constant for the println method; use Log.d.- See Also:
- Constant Field Values
-
INFO
public static final int INFO
Priority constant for the println method; use Log.i.- See Also:
- Constant Field Values
-
WARN
public static final int WARN
Priority constant for the println method; use Log.w.- See Also:
- Constant Field Values
-
ERROR
public static final int ERROR
Priority constant for the println method; use Log.e.- See Also:
- Constant Field Values
-
ASSERT
public static final int ASSERT
Priority constant for the println method.- See Also:
- Constant Field Values
-
LOG_ID_MAIN
public static final int LOG_ID_MAIN
- See Also:
- Constant Field Values
-
LOG_ID_RADIO
public static final int LOG_ID_RADIO
- See Also:
- Constant Field Values
-
LOG_ID_EVENTS
public static final int LOG_ID_EVENTS
- See Also:
- Constant Field Values
-
LOG_ID_SYSTEM
public static final int LOG_ID_SYSTEM
- See Also:
- Constant Field Values
-
LOG_ID_CRASH
public static final int LOG_ID_CRASH
- See Also:
- Constant Field Values
-
-
Method Detail
-
v
public static int v(java.lang.String tag, java.lang.String msg)Send aVERBOSElog message.- Parameters:
tag- Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.msg- The message you would like logged.
-
v
public static int v(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)Send aVERBOSElog message and log the exception.- Parameters:
tag- Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.msg- The message you would like logged.tr- An exception to log
-
d
public static int d(java.lang.String tag, java.lang.String msg)Send aDEBUGlog message.- Parameters:
tag- Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.msg- The message you would like logged.
-
d
public static int d(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)Send aDEBUGlog message and log the exception.- Parameters:
tag- Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.msg- The message you would like logged.tr- An exception to log
-
i
public static int i(java.lang.String tag, java.lang.String msg)Send anINFOlog message.- Parameters:
tag- Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.msg- The message you would like logged.
-
i
public static int i(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)Send aINFOlog message and log the exception.- Parameters:
tag- Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.msg- The message you would like logged.tr- An exception to log
-
w
public static int w(java.lang.String tag, java.lang.String msg)Send aWARNlog message.- Parameters:
tag- Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.msg- The message you would like logged.
-
w
public static int w(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)Send aWARNlog message and log the exception.- Parameters:
tag- Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.msg- The message you would like logged.tr- An exception to log
-
w
public static int w(java.lang.String tag, java.lang.Throwable tr)
-
e
public static int e(java.lang.String tag, java.lang.String msg)Send anERRORlog message.- Parameters:
tag- Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.msg- The message you would like logged.
-
e
public static int e(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)Send aERRORlog message and log the exception.- Parameters:
tag- Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.msg- The message you would like logged.tr- An exception to log
-
wtf
public static int wtf(java.lang.String tag, java.lang.String msg)
-
wtf
public static int wtf(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr)
-
wtf
public static int wtf(java.lang.String tag, java.lang.Throwable tr)
-
getStackTraceString
public static java.lang.String getStackTraceString(java.lang.Throwable tr)
Handy function to get a loggable stack trace from a Throwable- Parameters:
tr- An exception to log
-
println
public static int println(int priority, java.lang.String tag, java.lang.String msg)Low-level logging call.- Parameters:
priority- The priority/type of this log messagetag- Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.msg- The message you would like logged.- Returns:
- The number of bytes written.
-
println
public static int println(int bufID, int priority, java.lang.String tag, java.lang.String msg)
-
isLoggable
public static boolean isLoggable(java.lang.String var0, int var1)
-
-