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 行を解析し、キャプチャされたイベント ( |
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 のリッスンとイベントの解析を開始します。
イベント待ち
public GenericLogcatEventParser.LogcatEvent waitForEvent (long timeoutMs)
イベントを受け取るまでブロックします。
パラメーター | |
---|---|
timeoutMs | long : ミリ秒単位の待機時間 |
戻り値 | |
---|---|
GenericLogcatEventParser.LogcatEvent | タイムアウトに達した場合はイベントまたはnull |
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2023-04-28 UTC。