- 这样不行
System.out.print("哈哈哈");
这样可以
import android.util.Log;
Log.d("ggg", "666");


Log.i("哈哈哈", "666")
/**
* Send a {@link #DEBUG} 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 d(String tag, String msg) {
return println(LOG_ID_MAIN, DEBUG, tag, msg);
}
/**
* Send an {@link #INFO} 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 i(String tag, String msg) {
return println(LOG_ID_MAIN, INFO, tag, msg);
}
本文介绍了在Android开发中如何使用Log类记录不同级别的日志信息,包括DEBUG和INFO级别,并提供了具体的代码示例。
1746

被折叠的 条评论
为什么被折叠?



