LogcatEventParser
public class LogcatEventParser
extends Object
java.lang.Object | |
↳ | com.android.tradefed.util.LogcatEventParser |
Analisa a entrada do logcat para eventos.
Esta classe interpreta mensagens logcat e pode informar o ouvinte sobre eventos tanto de bloqueio quanto de pesquisa.
Resumo
Classes aninhadas | |
---|---|
class | LogcatEventParser.LogcatEvent Struct para manter um evento logcat com o tipo de evento e mensagem de disparo logcat |
Construtoras públicas | |
---|---|
LogcatEventParser (ITestDevice device) Instancia um novo LogcatEventParser |
Métodos públicos | |
---|---|
void | close () Pare de ouvir o logcat. |
void | parseEvents (String[] lines) Analise as linhas do logcat e adicione quaisquer eventos capturados (que foram registrados com |
LogcatEventParser.LogcatEvent | pollForEvent () Pesquisa a fila de eventos. |
void | registerEventTrigger (String tag, String msg, LogcatEventType response) Registre um evento de determinado tag logcat e mensagem com a resposta desejada. |
void | start () Comece a ouvir o logcat e analisar eventos. |
LogcatEventParser.LogcatEvent | waitForEvent (long timeoutMs) Bloqueia até receber um evento. |
Construtoras públicas
LogcatEventParser
public LogcatEventParser (ITestDevice device)
Instancia um novo LogcatEventParser
Parâmetros | |
---|---|
device | ITestDevice : para ler o logcat de |
Métodos públicos
perto
public void close ()
Pare de ouvir o logcat.
parseEvents
public void parseEvents (String[] lines)
Analise as linhas do logcat e adicione quaisquer eventos capturados (que foram registrados com registerEventTrigger(String, String, com.android.tradefed.util.LogcatEventType)
) à fila de eventos.
Parâmetros | |
---|---|
lines | String |
pollForEvent
public LogcatEventParser.LogcatEvent pollForEvent ()
Pesquisa a fila de eventos. Retorna imediatamente.
Devoluções | |
---|---|
LogcatEventParser.LogcatEvent | O evento ou null se nenhum evento correspondente for encontrado |
registerEventTrigger
public void registerEventTrigger (String tag, String msg, LogcatEventType response)
Registre um evento de determinado tag logcat e mensagem com a resposta desejada. A mensagem pode ser parcial.
Parâmetros | |
---|---|
tag | String |
msg | String |
response | LogcatEventType |
começar
public void start ()
Comece a ouvir o logcat e analisar eventos.
waitForEvent
public LogcatEventParser.LogcatEvent waitForEvent (long timeoutMs)
Bloqueia até receber um evento.
Parâmetros | |
---|---|
timeoutMs | long : Tempo de espera em milissegundos |
Devoluções | |
---|---|
LogcatEventParser.LogcatEvent | O evento ou null se o tempo limite for atingido |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2020-09-08 UTC.