Android开发6:日志信息输出
16lz
2021-01-23
Android开发
System.out.println();用这条语句是不能将信息打印到控制台的。
需要用到Log
android.util.Log
windows ==> Preferences ==> Android ==> DDMS ==> Logging Level
设置日志级别,选中之下的将被显示,选中之上的不被显示。
windows ==> Show View ==> Android ==> LogCat
显示LogCat栏目。
Summary
Constants
int
ASSERT
Priority constant for the println method.
int
DEBUG
Priority constant for the println method; use Log.d.
int
ERROR
Priority constant for the println method; use Log.e.
int
INFO
Priority constant for the println method; use Log.i.
int
VERBOSE
Priority constant for the println method; use Log.v.
int
WARN
Priority constant for the println method; use Log.w.
private static final String TAG = "MyActivity";
and use that in subsequent calls to the log methods.
Tip: Don't forget that when you make a call like
Log.v(TAG, "index=" + i);
学习交流>^<欢迎拍砖
更多相关文章
- android常用语句
- Android Studio module里面放switch语句报错 R文件找不到
- Android SDK 5.0 这个语句带来折腾 - 生命在于折腾!
- Android studio3.0 - 解决创建Java工程运行Java的main()入口函数
- Android控制台中运行Java程序
- Android中的那些sql语句
- Android怎么在控制台输出语句