GenericLogcatEventParser

public class GenericLogcatEventParser
extends Object

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


تحليل إدخال logcat للأحداث

تفسّر هذه الفئة رسائل logcat ويمكنها إبلاغ أداة معالجة الحدث بالأحداث بطريقتَي الحظر والاستقصاء.

ملخّص

الفئات المتداخلة

class GenericLogcatEventParser.LogcatEvent

بنية لتخزين حدث logcat مع نوع الحدث ورسالة logcat التي تؤدي إلى تشغيله 

الإنشاءات العامة

GenericLogcatEventParser(ITestDevice device)

إنشاء مثيل جديد لفئة LogcatEventParser

الطُرق العامة

void close()

أوقِف الاستماع إلى Logcat.

void parseEvents(String[] lines)

تحليل أسطر logcat وإضافة أي أحداث تم رصدها (تم تسجيلها باستخدام registerEventTrigger(String, String, LogcatEventType)) إلى قائمة انتظار الأحداث

GenericLogcatEventParser.LogcatEvent pollForEvent()

يستطلع قائمة انتظار الأحداث.

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

تسجيل حدث لعلامة logcat ورسالة معيّنة مع الردّ المطلوب

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

تسجيل حدث بمستوى logcat وعلامة ورسالة معيّنة مع الردّ المطلوب

void start()

ابدأ الاستماع إلى logcat وتحليل الأحداث.

GenericLogcatEventParser.LogcatEvent waitForEvent(long timeoutMs)

يتم الحظر إلى أن يتم تلقّي حدث.

الإنشاءات العامة

GenericLogcatEventParser

public GenericLogcatEventParser (ITestDevice device)

إنشاء مثيل جديد لفئة LogcatEventParser

المعلمات
device ITestDevice: لقراءة logcat من

الطُرق العامة

إغلاق

public void close ()

أوقِف الاستماع إلى Logcat.

parseEvents

public void parseEvents (String[] lines)

تحليل أسطر logcat وإضافة أي أحداث تم رصدها (تم تسجيلها باستخدام registerEventTrigger(String, String, LogcatEventType)) إلى قائمة انتظار الأحداث

المعلمات
lines String

pollForEvent

public GenericLogcatEventParser.LogcatEvent pollForEvent ()

يستطلع قائمة انتظار الأحداث. تعرض القيمة على الفور.

المرتجعات
GenericLogcatEventParser.LogcatEvent الحدث أو null إذا لم يتم العثور على حدث مطابق

registerEventTrigger

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

تسجيل حدث لعلامة logcat ورسالة معيّنتَين مع الردّ المطلوب قد تكون الرسالة جزئية.

المعلمات
tag String

msg String

response LogcatEventType

registerEventTrigger

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

تسجيل حدث بمستوى logcat وعلامة ورسالة معيّنة مع الردّ المطلوب قد تكون الرسالة جزئية.

المعلمات
logLevel Log.LogLevel

tag String

msg String

response LogcatEventType

بدء

public void start ()

ابدأ الاستماع إلى logcat وتحليل الأحداث.

waitForEvent

public GenericLogcatEventParser.LogcatEvent waitForEvent (long timeoutMs)

يتم الحظر إلى أن يتم تلقّي حدث.

المعلمات
timeoutMs long: مدة الانتظار بالملّي ثانية

المرتجعات
GenericLogcatEventParser.LogcatEvent الحدث أو null إذا تم بلوغ المهلة