標準輸出記錄器
public class StdoutLogger
extends Object
implements ILeveledLogOutput
java.lang.Object | |
↳ | com.android.tradefed.log.StdoutLogger |
將日誌訊息定向到標準輸出的ILeveledLogOutput
。
概括
公共構造函數 | |
---|---|
StdoutLogger () |
公共方法 | |
---|---|
ILeveledLogOutput | clone () |
void | closeLog () 根據需要關閉日誌並在關閉之前執行任何清理。 |
InputStreamSource | getLog () 抓取日誌資料的快照流。 |
Log.LogLevel | getLogLevel () 取得要顯示的最低日誌等級。 |
void | init () 初始化日誌,建立任何所需的 IO 資源。 |
void | printAndPromptLog (Log.LogLevel logLevel, String tag, String message) |
void | printLog (Log.LogLevel logLevel, String tag, String message) |
void | setLogLevel (Log.LogLevel logLevel) 設定要顯示的最低日誌等級。 |
公共構造函數
標準輸出記錄器
public StdoutLogger ()
公共方法
關閉日誌
public void closeLog ()
根據需要關閉日誌並在關閉之前執行任何清理。
取得日誌
public InputStreamSource getLog ()
抓取日誌資料的快照流。
不得在ILeveledLogOutput#closeLog()
之後呼叫。
不保證返回的串流具有最佳效能。呼叫者可能希望將結果包裝在ERROR(/BufferedInputStream)
中。
退貨 | |
---|---|
InputStreamSource | 日誌資料的InputStreamSource 。如果不支持,可能會傳回 null。 |
在裡面
public void init ()
初始化日誌,建立任何所需的 IO 資源。
列印並提示日誌
public void printAndPromptLog (Log.LogLevel logLevel, String tag, String message)
參數 | |
---|---|
logLevel | Log.LogLevel |
tag | String |
message | String |
列印日誌
public void printLog (Log.LogLevel logLevel, String tag, String message)
參數 | |
---|---|
logLevel | Log.LogLevel |
tag | String |
message | String |
設定日誌等級
public void setLogLevel (Log.LogLevel logLevel)
設定要顯示的最低日誌等級。
參數 | |
---|---|
logLevel | Log.LogLevel :要顯示的LogLevel |