17

I cannot get LibGDX logging to work in Android Studio. First i thought I had the same problem as my previous question but made sure my app updated on debug.

playButton.addListener(new ChangeListener()
    {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
        Gdx.app.debug("BUTTON", "playButton Pressed");
        optionButton.addAction(Actions.moveBy(-200, 0, 2));
    }

});

The test action on the option button is carried out but i cannot get the debug log to show up.

Madmenyo
  • 8,389
  • 7
  • 52
  • 99

2 Answers2

19

The default Log level is LOG_INFO. For the Gdx.app.debug call to work, you must first call Gdx.app.setLogLevel(Application.LOG_DEBUG); once (probably the first line in your Game's constructor so you can easily change it).

Tenfour04
  • 83,111
  • 11
  • 94
  • 154
  • I do that, but yet I still see no log output. It works when logging using `log`, but never using `debug`. Any other ideas what I might be missing? I made sure to enable the log tags in question on the emulator using `adb shell setprop` as well – mxk Nov 02 '14 at 15:56
  • On the Android side, you also have to compile a debug build, which I think is the default when you press Run in Android Studio. If using Eclipse, make sure you set `debuggable="true"` in the manifest inside the `application` element. And make sure your filter in the IDE is set to include debug messages. – Tenfour04 Nov 02 '14 at 22:34
5

Use Gdx.app.log or even System.out.println (write sout (syso in eclipse) and enter );

Boldijar Paul
  • 5,405
  • 9
  • 46
  • 94