GenericLogcatEventParser

public class GenericLogcatEventParser
extends Object

java.lang.객체
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 듣기를 중지하십시오.

구문 분석 이벤트

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