android 源码log肿么查看

Android

1个回答

写回答

13827092289

2026-02-17 18:46

+ 关注

Android
Android

今天我们将介绍Log对象,它位于Android框架层的utils包下。Log对象是一个final class类,用于记录日志信息。具体定义如下:

public final class Log {

/ * Priority constant for the println method; use Log.v. */ public static final int VERBOSE = 2;

AI
AI

/ * Priority constant for the println method; use Log.d. */ public static final int DEBUG = 3;

/ * Priority constant for the println method; use Log.i. */ public static final int INFO = 4;

/ * Priority constant for the println method; use Log.w. */ public static final int WARN = 5;

/ * Priority constant for the println method; use Log.e. */ public static final int ERROR = 6;

/ * Priority constant for the println method. */ public static final int ASSERT = 7;

private Log() { }

/ * Send a {@link #VERBOSE} log message. * @param tag Used to identify the source of a log message. It usually identifies * the class or activity where the log call occurs. * @param msg The message you would like logged. */ public static int v(String tag, String msg) { return println(LOG_ID_MAIN, VERBOSE, tag, msg); }

/ * Send a {@link #VERBOSE} log message and log the exception. * @param tag Used to identify the source of a log message. It usually identifies * the class or activity where the log call occurs. * @param msg The message you would like logged. * @param tr An exception to log */ public static int v(String tag, String msg, Throwable tr) { return println(LOG_ID_MAIN, VERBOSE

举报有用(0分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号