登录工具
public class LogUtil
extends Object
java.lang.Object | |
↳ | com.android.tradefed.log.LogUtil |
一个日志实用程序类。对于需要从Log
覆盖静态方法的代码很有用
概括
嵌套类 | |
---|---|
class | LogUtil.CLog |
公共方法 | |
---|---|
static String | getLogFormatString (Log.LogLevel logLevel, String tag, String message) 创建类似于设备上“threadtime”日志格式的格式字符串。 |
static void | printLog (Log.LogLevel logLevel, String tag, String message) 当需要打印日志消息时发送。 |
公共方法
获取日志格式字符串
public static String getLogFormatString (Log.LogLevel logLevel, String tag, String message)
创建类似于设备上“threadtime”日志格式的格式字符串。这是特别有用的,因为它包括日和月(以区分长时间运行的 TF 实例的时间),并且还使用 24 小时时间来区分早上和晚上。
参数 | |
---|---|
logLevel | Log.LogLevel |
tag | String |
message | String |
退货 | |
---|---|
String |
打印日志
public static void printLog (Log.LogLevel logLevel, String tag, String message)
当需要打印日志消息时发送。此实现在所有情况下都将消息打印到标准输出。
参数 | |
---|---|
logLevel | Log.LogLevel :表示消息优先级的LogLevel 枚举。 |
tag | String : 与消息关联的标签。 |
message | String : 要显示的消息。 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-03-30。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]