LogCat中不显示我的日志调用 [英] Logcat not displaying my log calls

查看:131
本文介绍了LogCat中不显示我的日志调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android的编程共小白,想学习如何调试我的应用程序。我似乎无法让我的Log.i | D |在LogCat中显示v通话。

下面是我使用的code。正如你可以看到我已经定义了一个LOG_TAG不变,但似乎无法找到它的LogCat中。我也进口android.util.Log,我已经确信,在我的Andr​​oidManifest我有可调试设置为TRUE。

我还检查<一href="http://developer.android.com/reference/android/util/Log.html">http://developer.android.com/reference/android/util/Log.html W / O任何侥幸解决这一问题。

我是什么做错了吗?难道我连看在正确的地方?我已经使用DDMS和Debug视角,以及W / O任何侥幸尝试。任何帮助这个菜鸟会大大AP preciated。谢谢你。

我的环境: Windows XP中 IDE = Eclipse版本:3.6.1,构建ID:M20100909-0800 仿真器=有它指向的Andr​​oid SDK 2.1 API 7

//非常基本的Hello World code与一对夫妇Log.i来电

 进口android.app.Activity;
进口android.os.Bundle;
进口android.util.Log;

公共类调试器扩展了活动{
    私有静态最后弦乐LOG_TAG =调试;

    / **第一次创建活动时调用。 * /
    @覆盖
    公共无效的onCreate(包savedInstanceState){
        Log.i(LOG_TAG,13号线);
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.main);

        Log.i(LOG_TAG创建NOW);
    }
}
 

解决方案

在使用Eclipse,在DDMS透视图,确保正确的设备(propably仿真器-XXXX)被选中并突出显示。只有这样,你在的logcat视图中的logcat输出。

另外,Android插件是有点quircky,有时只显示了的logcat视图的最后一行。如果发生这种情况,尝试清除日志。在这之后,你应该让所有的日志条目再(为我工作反正)。

I'm a total noob at Android programming, and wanted to learn how to debug my apps. I can't seem to have my Log.i|d|v calls displayed in the LogCat.

Here's the code that I'm using. As you can see I have defined a LOG_TAG constant, but can't seem to find it in the LogCat. I have also imported android.util.Log AND I have made sure that in my AndroidManifest I have "debuggable" set to TRUE.

I have also checked http://developer.android.com/reference/android/util/Log.html w/o any luck resolving this issue.

What am I doing wrong? Am I even looking in the right place? I've tried using the DDMS and Debug perspective as well w/o any luck. Any help to this noob would be greatly appreciated. Thanks.

My environment: Windows XP IDE = Eclipse Version: 3.6.1, Build id: M20100909-0800 Emulator = having it point to android sdk 2.1 api 7

//very basic HELLO World code with a couple of Log.i calls

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class debugger extends Activity {
    private static final String LOG_TAG = "debugger";

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        Log.i(LOG_TAG, "line 13");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Log.i(LOG_TAG, "CREATING NOW");
    }
}

解决方案

When using Eclipse, in the DDMS perspective, make sure the correct device (propably emulator-xxxx) is selected and highlighted. Only then will you get the logcat output in the logcat view.

Also, the Android plugin is a bit quircky, and sometimes only shows the last line in the logcat view. If this happens, try to clear the log. After that, you should get all the log entries again (works for me anyway).

这篇关于LogCat中不显示我的日志调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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