LogUtil

public class LogUtil
extends Object

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


A logging utility class. Useful for code that needs to override static methods from Log

Summary

Nested classes

class LogUtil.CLog

A shim class for Log that automatically uses the simple classname of the caller as the log tag  

Public methods

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

Creates a format string that is similar to the "threadtime" log format on the device.

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

Sent when a log message needs to be printed.

Public methods

getLogFormatString

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

Creates a format string that is similar to the "threadtime" log format on the device. This is specifically useful because it includes the day and month (to differentiate times for long-running TF instances), and also uses 24-hour time to disambiguate morning from evening.

Parameters
logLevel Log.LogLevel
tag String
message String
Returns
String

printLog

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

Sent when a log message needs to be printed. This implementation prints the message to stdout in all cases.

Parameters
logLevel Log.LogLevel: The Log.LogLevel enum representing the priority of the message.
tag String: The tag associated with the message.
message String: The message to display.