GenericLogcatEventParser

public class GenericLogcatEventParser
extends Object

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


ניתוח קלט של logcat לאירועים.

הכיתה הזו מפרשת הודעות logcat ויכולה להודיע למאזין על אירועים גם באופן חוסם וגם באופן של סקרים.

סיכום

כיתות בתצוגת עץ

class GenericLogcatEventParser.LogcatEvent

מבנה נתונים (struct) לאירוע ב-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 אם פג התוקף