GenericLogcatEventParser
public
class
GenericLogcatEventParser
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.util.GenericLogcatEventParser<LogcatEventType> |
ניתוח של קלט logcat לאירועים.
המחלקות האלה מפרשות הודעות logcat ויכולות להודיע ל-listener על אירועים גם בשיטת חסימה וגם בשיטת סקר.
סיכום
כיתות במבנה היררכי | |
|---|---|
class |
GenericLogcatEventParser.LogcatEvent
מבנה להחזקת אירוע logcat עם סוג האירוע והודעת logcat שמפעילה אותו |
Constructors ציבוריים | |
|---|---|
GenericLogcatEventParser(ITestDevice device)
יוצר מופע חדש של LogcatEventParser |
|
methods ציבוריים | |
|---|---|
void
|
close()
מפסיקים להאזין ל-logcat. |
void
|
parseEvents(String[] lines)
מנתחים את השורות ב-logcat ומוסיפים לתור האירועים את כל האירועים שתועדו (שנרשמו באמצעות |
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)
הפונקציה חוסמת עד שהיא מקבלת אירוע. |
Constructors ציבוריים
GenericLogcatEventParser
public GenericLogcatEventParser (ITestDevice device)
יוצר מופע חדש של LogcatEventParser
| פרמטרים | |
|---|---|
device |
ITestDevice: כדי לקרוא את ה-LogCat מתוך |
methods ציבוריים
סגירה
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 אם מגיעים לזמן הקצוב לתפוגה |