Log
public
final
class
Log
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.log.Log |
Klasa Log, która odzwierciedla interfejs API w głównych źródłach Androida.
Domyślne działanie polega na zapisywaniu logu w System.out. Aby przekierować log w inne miejsce, użyj setLogOutput(ILogOutput).
Podsumowanie
Zagnieżdżone klasy | |
|---|---|
interface |
Log.ILogOutput
Klasy, które implementują ten interfejs, udostępniają metody obsługujące wyświetlanie wiadomości logu. |
Metody publiczne | |
|---|---|
static
void
|
addLogger(Log.ILogOutput logOutput)
|
static
void
|
d(String tag, String message)
Wyświetla wiadomość na poziomie |
static
void
|
e(String tag, String message)
Wyświetla wiadomość na poziomie |
static
void
|
e(String tag, Throwable throwable)
Wyświetla informacje |
static
String
|
getLogFormatString(Log.LogLevel logLevel, String tag, String message)
Formatuje komunikat logu. |
static
void
|
i(String tag, String message)
Wyświetla wiadomość na poziomie |
static
void
|
logAndDisplay(Log.LogLevel logLevel, String tag, String message)
Wyświetla komunikat logu i próbuje wyświetlić go w oknie. |
static
void
|
printLog(Log.LogLevel logLevel, String tag, String message)
Wyświetla komunikat logu. |
static
void
|
removeLogger(Log.ILogOutput logOutput)
|
static
void
|
setLogOutput(Log.ILogOutput logOutput)
Ustawia |
static
void
|
v(String tag, String message)
Wyświetla wiadomość na poziomie |
static
void
|
w(String tag, String message)
Wyświetla wiadomość na poziomie |
Metody publiczne
addLogger
public static void addLogger (Log.ILogOutput logOutput)
| Parametry | |
|---|---|
logOutput |
Log.ILogOutput |
d
public static void d (String tag,
String message)Wyświetla wiadomość na poziomie LogLevel.DEBUG.
| Parametry | |
|---|---|
tag |
String: tag powiązany z wiadomością. |
message |
String: wiadomość do wyświetlenia. |
e
public static void e (String tag,
String message)Wyświetla wiadomość na poziomie LogLevel.ERROR.
| Parametry | |
|---|---|
tag |
String: tag powiązany z wiadomością. |
message |
String: wiadomość do wyświetlenia. |
e
public static void e (String tag,
Throwable throwable)Wyświetla informacje Throwable na poziomie LogLevel.ERROR.
| Parametry | |
|---|---|
tag |
String: tag powiązany z wiadomością. |
throwable |
Throwable: Throwable do wyświetlenia. |
getLogFormatString
public static String getLogFormatString (Log.LogLevel logLevel, String tag, String message)
Formatuje komunikat logu.
| Zwraca | |
|---|---|
String |
|
i
public static void i (String tag,
String message)Wyświetla wiadomość na poziomie LogLevel.INFO.
| Parametry | |
|---|---|
tag |
String: tag powiązany z wiadomością. |
message |
String: wiadomość do wyświetlenia. |
logAndDisplay
public static void logAndDisplay (Log.LogLevel logLevel, String tag, String message)
Wyświetla komunikat logu i próbuje wyświetlić go w oknie.
| Parametry | |
|---|---|
logLevel |
Log.LogLevel |
tag |
String: tag powiązany z wiadomością. |
message |
String: wiadomość do wyświetlenia. |
printLog
public static void printLog (Log.LogLevel logLevel, String tag, String message)
Wyświetla komunikat logu.
removeLogger
public static void removeLogger (Log.ILogOutput logOutput)
| Parametry | |
|---|---|
logOutput |
Log.ILogOutput |
setLogOutput
public static void setLogOutput (Log.ILogOutput logOutput)
Ustawia ILogOutput, który ma być używany do wyświetlania logów. Jeśli nie zostanie ustawiony, System.out będzie
używany.
| Parametry | |
|---|---|
logOutput |
Log.ILogOutput: ILogOutput, który ma być używany do wyświetlania logu. |
v
public static void v (String tag,
String message)Wyświetla wiadomość na poziomie LogLevel.VERBOSE.
| Parametry | |
|---|---|
tag |
String: tag powiązany z wiadomością. |
message |
String: wiadomość do wyświetlenia. |
w
public static void w (String tag,
String message)Wyświetla wiadomość na poziomie LogLevel.WARN.
| Parametry | |
|---|---|
tag |
String: tag powiązany z wiadomością. |
message |
String: wiadomość do wyświetlenia. |