问题
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.
回答1:
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).
回答2:
Use Gdx.app.log or even System.out.println (write sout (syso in eclipse) and enter );
来源:https://stackoverflow.com/questions/26241333/libgdx-logging-not-showing-up-in-logcat