logcat的日志警告/错误 [英] Logcat log warning/errors

查看:139
本文介绍了logcat的日志警告/错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过ADB连接我的银河S3的迷你,并尝试与机器人工作室调试应用程序,我得到无尽的错误/在logcat的警告信息,不停的消息是这样的疯狂。这是否正常?通常用模拟器我没有得到吨的消息在logcat中。我该如何解决这个问题?这里是如何logcat的样子 http://pastebin.com/JaVhYaCt 或的 http://i.imgur.com/aaavMZm.png?1

顺便说一句:我仍然能够测试应用程序

解决方案
  

那是正常的吗?

是 - 该系统本身以及每个应用程序使用记录,这就是你看到的。的精简版仿真器不会有接收器和服务运行,所以你不会看到记录相同数量的许多应用程序。

  

我怎样才能解决这个问题呢?

您不能这样,但你可以强制关闭从设备的设定各种应用程序酌减。不一定是个好主意,但它是你的选择。

您可以通过在你的code封装标签和然后应用过滤器只显示logcat的数据与您的标签提高的东西。

示例...

 包com.mycompany.mypackage

公共类MyActivity延伸活动{

    受保护的最终字符串变量=的getClass()的getName()。

}
 

在上述标记将com.mycompany.mypackage.MyActivity。使用保护作为改性剂,以便其扩展任何类 MyActivity 将自动分配自己的类名标记

在登录你只需要使用`Log.d(TAG,一些文本);

您那么就需要在com.mycompany.mypackage过滤器,只看到从自己的应用程序组件的日志记录。

When I connect my galaxy s3 mini via ADB and try debug application with android studio I get endless error/warning messages in logcat, non-stop messages goes like crazy. Is that normal? Usually with emulator I don't get tons of message in logcat. How can I fix this problem? here's how logcat looks like http://pastebin.com/JaVhYaCt or http://i.imgur.com/aaavMZm.png?1

By the way: I still able to test applications.

解决方案

Is that normal?

Yes - the system itself as well as every app uses logging and that's what you're seeing. A bare-bones emulator won't have many apps with receivers and services running so you won't see the same amount of logging.

How can I fix this problem?

You can't as such but you can reduce it by force closing various apps from "Settings" on the device. Not necessarily a good idea but it's your choice.

You can improve things by using package TAGs in your code and then applying a filter to only show logcat data with your TAGs.

Example...

package com.mycompany.mypackage

public class MyActivity extends Activity {

    protected final String TAG = getClass().getName();

}

In the above TAG will be "com.mycompany.mypackage.MyActivity". Use protected as the modifier so any classes which extend MyActivity will automatically assign their own class name to TAG.

When logging you just use `Log.d(TAG, "Some text");

You then just need to filter on "com.mycompany.mypackage" to only see logging from your own app components.

这篇关于logcat的日志警告/错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆