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 |
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
public 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. 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
public static 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 LogLevel enum representing the priority of the message. |
tag |
String: The tag associated with the message. |
message |
String: The message to display. |
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 2024-08-13 UTC.