请问 Android.util.log 这个类在 android 源码中哪个包呢
答案:2 悬赏:60 手机版
解决时间 2021-01-04 12:43
- 提问者网友:浩歌待明月
- 2021-01-03 12:01
请问 Android.util.log 这个类在 android 源码中哪个包呢?找了半天没找到
最佳答案
- 五星知识达人网友:拾荒鲤
- 2021-01-03 13:09
就在android.util这个包下面。在frameworks/base/core下面,可以搜索一下find ./frameworks/base -name Log.java
全部回答
- 1楼网友:刀戟声无边
- 2021-01-03 14:08
当然他是用ddms的logcat来查看,上面分别有显示v,d,i,w,e
d:表示debug,就是代码中的log.d("tips","degug");
v:表示view,就是代码中的log.v("tips","verbose");
i:表示debug,就是代码中的log.i("tips","info");
e:表示debug,就是代码中的log.e("tips","error");
……………………
不同的方法在logcat里面显示的颜色不同,你可以根据你的需要来决定用哪个方法,然后通过上面的v,d,i,w,e来过滤掉你不需要的东西
verbose should never be compiled into an application except during development. debug logs are compiled in but stripped at runtime. error, warning and info logs are always kept.
tip: don't forget that when you make a call like log.v(tag, "index=" + i); that when you're building the string to pass into log.d, java uses a stringbuilder and at least three allocations occur: the stringbuilder itself, the buffer, and the string object. realistically, there is also another buffer allocation and copy, and even more pressure on the gc. that means that if your log message is filtered out, you might be doing significant work and incurring significant overhead.
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯