Log
public
final
class
Log
extends Object
java.lang.Object | |
↳ | com.android.tradefed.log.Log |
Log class that mirrors the API in main Android sources.
Default behavior outputs the log to System.out
. Use setLogOutput(com.android.tradefed.log.Log.ILogOutput)
to redirect the log somewhere else.
Summary
Nested classes | |
---|---|
interface |
Log.ILogOutput
Classes which implement this interface provides methods that deal with outputting log messages. |
Public methods | |
---|---|
static
void
|
d(String tag, String message)
Outputs a |
static
void
|
e(String tag, String message)
Outputs a |
static
void
|
e(String tag, Throwable throwable)
Outputs a |
static
String
|
getLogFormatString(Log.LogLevel logLevel, String tag, String message)
Formats a log message. |
static
void
|
i(String tag, String message)
Outputs a |
static
void
|
logAndDisplay(Log.LogLevel logLevel, String tag, String message)
Outputs a log message and attempts to display it in a dialog. |
static
void
|
printLog(Log.LogLevel logLevel, String tag, String message)
Prints a log message. |
static
void
|
setLogOutput(Log.ILogOutput logOutput)
Sets the |
static
void
|
v(String tag, String message)
Outputs a |
static
void
|
w(String tag, String message)
Outputs a |
Public methods
d
public static void d (String tag, String message)
Outputs a LogLevel#DEBUG
level message.
Parameters | |
---|---|
tag |
String : The tag associated with the message. |
message |
String : The message to output. |
e
public static void e (String tag, String message)
Outputs a LogLevel#ERROR
level message.
Parameters | |
---|---|
tag |
String : The tag associated with the message. |
message |
String : The message to output. |
e
public static void e (String tag, Throwable throwable)
Outputs a LogLevel#ERROR
level Throwable
information.
Parameters | |
---|---|
tag |
String : The tag associated with the message. |
throwable |
Throwable : The Throwable to output. |
getLogFormatString
public static String getLogFormatString (Log.LogLevel logLevel, String tag, String message)
Formats a log message.
Returns | |
---|---|
String |
i
public static void i (String tag, String message)
Outputs a LogLevel#INFO
level message.
Parameters | |
---|---|
tag |
String : The tag associated with the message. |
message |
String : The message to output. |
logAndDisplay
public static void logAndDisplay (Log.LogLevel logLevel, String tag, String message)
Outputs a log message and attempts to display it in a dialog.
Parameters | |
---|---|
logLevel |
Log.LogLevel |
tag |
String : The tag associated with the message. |
message |
String : The message to output. |
printLog
public static void printLog (Log.LogLevel logLevel, String tag, String message)
Prints a log message.
setLogOutput
public static void setLogOutput (Log.ILogOutput logOutput)
Sets the ILogOutput
to use to print the logs. If not set, System.out
will be
used.
Parameters | |
---|---|
logOutput |
Log.ILogOutput : The ILogOutput to use to print the log. |
v
public static void v (String tag, String message)
Outputs a LogLevel#VERBOSE
level message.
Parameters | |
---|---|
tag |
String : The tag associated with the message. |
message |
String : The message to output. |
w
public static void w (String tag, String message)
Outputs a LogLevel#WARN
level message.
Parameters | |
---|---|
tag |
String : The tag associated with the message. |
message |
String : The message to output. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-08-13 UTC.