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

תפסיק להקשיב ללוגקט.

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

תפסיק להקשיב ללוגקט.

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 אם הגיע הזמן הקצוב