GenericLogcatEventParser

public class GenericLogcatEventParser
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.GenericLogcatEventParser<LogcatEventType>


Mengurai input logcat untuk peristiwa.

Class ini menafsirkan pesan logcat dan dapat memberi tahu pemroses tentang peristiwa secara pemblokiran dan polling.

Ringkasan

Class bertingkat

class GenericLogcatEventParser.LogcatEvent

Struct untuk menyimpan peristiwa logcat dengan jenis peristiwa dan pesan logcat pemicu 

Konstruktor publik

GenericLogcatEventParser(ITestDevice device)

Membuat instance LogcatEventParser baru

Metode publik

void close()

Berhenti memproses logcat.

void parseEvents(String[] lines)

Mengurai baris logcat dan menambahkan peristiwa yang direkam (yang terdaftar dengan registerEventTrigger(String, String, LogcatEventType)) ke antrean peristiwa.

GenericLogcatEventParser.LogcatEvent pollForEvent()

Melakukan polling pada antrean peristiwa.

void registerEventTrigger(String tag, String msg, LogcatEventType response)

Daftarkan peristiwa tag dan pesan logcat tertentu dengan respons yang diinginkan.

void registerEventTrigger(Log.LogLevel logLevel, String tag, String msg, LogcatEventType response)

Daftarkan peristiwa dengan level logcat, tag, dan pesan tertentu dengan respons yang diinginkan.

void start()

Mulai memproses logcat dan mengurai peristiwa.

GenericLogcatEventParser.LogcatEvent waitForEvent(long timeoutMs)

Memblokir hingga menerima acara.

Konstruktor publik

GenericLogcatEventParser

public GenericLogcatEventParser (ITestDevice device)

Membuat instance LogcatEventParser baru

Parameter
device ITestDevice: untuk membaca logcat dari

Metode publik

tutup

public void close ()

Berhenti memproses logcat.

parseEvents

public void parseEvents (String[] lines)

Mengurai baris logcat dan menambahkan peristiwa yang direkam (yang terdaftar dengan registerEventTrigger(String, String, LogcatEventType)) ke antrean peristiwa.

Parameter
lines String

pollForEvent

public GenericLogcatEventParser.LogcatEvent pollForEvent ()

Melakukan polling pada antrean peristiwa. Langsung ditampilkan.

Hasil
GenericLogcatEventParser.LogcatEvent Acara atau null jika tidak ada acara yang cocok ditemukan

registerEventTrigger

public void registerEventTrigger (String tag, 
                String msg, 
                LogcatEventType response)

Daftarkan peristiwa tag dan pesan logcat tertentu dengan respons yang diinginkan. Pesan mungkin tidak lengkap.

Parameter
tag String

msg String

response LogcatEventType

registerEventTrigger

public void registerEventTrigger (Log.LogLevel logLevel, 
                String tag, 
                String msg, 
                LogcatEventType response)

Daftarkan peristiwa dengan level logcat, tag, dan pesan tertentu dengan respons yang diinginkan. Pesan mungkin tidak lengkap.

Parameter
logLevel Log.LogLevel

tag String

msg String

response LogcatEventType

start

public void start ()

Mulai memproses logcat dan mengurai peristiwa.

waitForEvent

public GenericLogcatEventParser.LogcatEvent waitForEvent (long timeoutMs)

Memblokir hingga menerima acara.

Parameter
timeoutMs long: Waktu tunggu dalam milidetik

Hasil
GenericLogcatEventParser.LogcatEvent Peristiwa atau null jika waktu tunggu tercapai