如何在react本机模块中使用log.d?

s8vozzvw  于 2021-06-30  发布在  Java
关注(0)|答案(1)|浏览(307)

我想看看在本机模块中何时激发某些方法。
我已经进口了

import android.util.Log;

在我要写入日志的java文件中。
这是我想记录的方法。

public void play(int frequency, double duration, double amplitude, int mode) {
        BlueManager blueManager = BLueServiceManager.getSharedBlueManager();
        if (blueManager == null || !blueManager.isConnected()) {
            return;
        }

        byte actualFreq = (byte) (frequency / EQ_STEP_SIZE);
        short actualDuration = (short) (duration * 1800);
        blueManager.playTone(actualFreq, actualDuration, amplitude);
    }

我试图补充

Log.d("is this thing working???", "I certainly hope so");

方法内部。
我打开了android工作室,我正在看logcat窗口。即使我知道我已经访问了那个方法,我也看不到我的消息。

ejk8hzay

ejk8hzay1#

在logcat中,我可以看到,您只选择了“info”消息来显示。
Log.d() 代表调试消息,因此不在“info”下( Log.i() )消息。
更改并选择“调试”。你会看到消息的。或者选择“verbose”查看所有消息,无论哪种类型。

相关问题