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: 로그캣을 읽을 위치

공개 메서드

닫기

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

start

public void start ()

logcat을 수신하고 이벤트를 파싱하기 시작합니다.

waitForEvent

public GenericLogcatEventParser.LogcatEvent waitForEvent (long timeoutMs)

이벤트를 수신할 때까지 차단합니다.

매개변수
timeoutMs long: 대기 시간(밀리초)

반환 값
GenericLogcatEventParser.LogcatEvent 시간 제한에 도달한 경우 이벤트 또는 null