LogUtil

public class LogUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.log.LogUtil


記錄公用程式類別。適用於需要覆寫 Log 中靜態方法的程式碼

摘要

巢狀類別

class LogUtil.CLog

Log 的墊片類別,會自動使用呼叫端的簡單類別名稱做為記錄標記 

公用方法

static String getLogFormatString(Log.LogLevel logLevel, String tag, String message)

建立類似於裝置上「threadtime」記錄格式的格式字串。

static void printLog(Log.LogLevel logLevel, String tag, String message)

需要列印記錄訊息時傳送。

公用方法

getLogFormatString

public static String getLogFormatString (Log.LogLevel logLevel, 
                String tag, 
                String message)

建立類似於裝置上「threadtime」記錄格式的格式字串。這項資訊特別實用,因為其中包含日期和月份 (可區分長時間執行的 TF 執行個體時間),且使用 24 小時制,可區分上午和晚上。

參數
logLevel Log.LogLevel

tag String

message String

傳回
String

printLog

public static void printLog (Log.LogLevel logLevel, 
                String tag, 
                String message)

需要列印記錄訊息時傳送。這個實作方式一律會將訊息列印至 stdout。

參數
logLevel Log.LogLevel:代表訊息優先順序的 LogLevel 列舉。

tag String:與訊息相關聯的標記。

message String:要顯示的訊息。