Logcat - Does not appear

Asked

Viewed 1,710 times

1

I am making the Example 5 of the cap 3 of the book Google Android 3ºed(Ricardo R.Lecheta), where applying a filter to display on the logcat. only you’re not returning anything to me.

package br.livro.android.cap3;

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


public class Exemplo5 extends Activity {
    private static final String CATEGORIA = "livro";

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        setContentView(R.layout.main);

        // Verbose
        Log.v(CATEGORIA, "log de verbose");

        // Debug
        Log.d(CATEGORIA, "log de debug");

        // Info
        Log.i(CATEGORIA, "log de info");

        // Warn
        Log.w(CATEGORIA, "log de alerta");

        // Error
        Log.e(CATEGORIA, "log de erro", new RuntimeException("teste de erro"));
    }
}

print

  • 1

    I’m without the Eclipse here (using the Android Studio), but you have already tried to run the logcat in hand? (adb logcat). Maybe the IDE is redirecting the stdout or something like that (Official Documentation of Google).

  • Do as @Anthonyaccioly said to see if it works.

  • using the command (adb logcat) returns me some more information than I typed in my class, have to use filter or should appear?

  • @Josinaldo when you remove the filter and keep using the emulator, the logs keep appearing?

  • 1

    I tested on another project and it worked :), must be some error I made in the application, thanks to all.

1 answer

1

Try to open the DDMS perspective (top right), and select the device you want to view the Logcat Output.

Example: selecting the device "015DC1F50600" to display the Logcat.

DDMS

  • nothing :(worse than I can’t even skip this part of the book because it’s essential. (http://s16.postimg.org/eynkqshnp/Screenshot_erro_eclipse2.png)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.