android.util.log输出内容中有线程id吗
1个回答
2017-03-23
展开全部
当然他是用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.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询