Dziennik

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 dziennika w System.out. Użyj znaku setLogOutput(com.android.tradefed.log.Log.ILogOutput), aby przekierować dziennik w inne miejsce.

Podsumowanie

Zagnieżdżone klasy

interface Log.ILogOutput

Klasy, które implementują ten interfejs, udostępniają metody obsługi komunikatów logu. 

Metody publiczne

static void addLogger(Log.ILogOutput logOutput)
static void d(String tag, String message)

Wyświetla komunikat na poziomie LogLevel.DEBUG.

static void e(String tag, String message)

Wyświetla komunikat na poziomie LogLevel.ERROR.

static void e(String tag, Throwable throwable)

Zwraca informacje o poziomie LogLevel.ERROR Throwable.

static String getLogFormatString(Log.LogLevel logLevel, String tag, String message)

Formatuje wiadomość dziennika.

static void i(String tag, String message)

Wyświetla komunikat na poziomie LogLevel.INFO.

static void logAndDisplay(Log.LogLevel logLevel, String tag, String message)

Wyświetla komunikat dziennika i próbuje go wyświetlić w oknie.

static void printLog(Log.LogLevel logLevel, String tag, String message)

Drukuje komunikat logu.

static void removeLogger(Log.ILogOutput logOutput)
static void setLogOutput(Log.ILogOutput logOutput)

Ustawia ILogOutput, który ma być używany do drukowania logów.

static void v(String tag, String message)

Wyświetla komunikat na poziomie LogLevel.VERBOSE.

static void w(String tag, String message)

Wyświetla komunikat na poziomie LogLevel.WARN.

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 komunikat 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 komunikat 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)

Zwraca informacje o poziomie LogLevel.ERROR Throwable.

Parametry
tag String: tag powiązany z wiadomością.

throwable Throwable: Throwable do wygenerowania.

getLogFormatString

public static String getLogFormatString (Log.LogLevel logLevel, 
                String tag, 
                String message)

Formatuje wiadomość dziennika.

Zwroty
String

I

public static void i (String tag, 
                String message)

Wyświetla komunikat 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 dziennika i próbuje go wyświetlić 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)

Drukuje 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 drukowania logów. Jeśli nie zostanie ustawiona, użyta zostanie wartość System.out.

Parametry
logOutput Log.ILogOutput: ILogOutput, którego należy użyć do wydrukowania logu.

v

public static void v (String tag, 
                String message)

Wyświetla komunikat 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 komunikat na poziomie LogLevel.WARN.

Parametry
tag String: tag powiązany z wiadomością.

message String: wiadomość do wyświetlenia.