我正在寻找一种方法来向自己发送消息,以便在设备上调试我的应用程序。如果我理解正确,LogCat
用于此目的。但是我无法将消息发送/输出到 LogCat
。
我尝试了以下但没有结果:
System.out.println("Message"); //Outputs to console when in desktop app, nothing on device.
Log.i + Log.d + Log.w //These methods do not exist. And i cannot get `Log` to work in any other way.
Debug.println("Msg1", "Msg2"); //Ends up in a error on device.
我只是想在我的手机上给自己发送“调试”信息,比如点击的坐标。如果为此目的不需要 LogCat
,我不一定需要它。
最佳答案
android.util.Log
是具有您想要的方法的类,即 Log.i()、Log.w() 等。
如果它们“不存在”,请确保您正在导入该类。
编辑:抱歉,错过了 libgdx 标签。在 LibGDX 中,请改用这些方法:
Gdx.app.log("MyTag", "my informative message");
Gdx.app.error("MyTag", "my error message", exception);
Gdx.app.debug("MyTag", "my debug message");
关于android - 向 LogCat 发送消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24918024/