java - 如何在 react-native 本机模块中使用 Log.d?
问题描述
我想看看某些方法何时在本机模块中被触发。
我已经进口了
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 Studio,正在查看 Logcat 窗口。即使我知道我已经访问了该方法,我也没有在任何地方看到我的消息。
解决方案
推荐阅读
- python - 从 XML 导入数据时为行分配可识别的唯一 ID
- java - 嵌套在类中的接口可以是非静态的吗?
- django - 在设置文件中将 Django 频道添加到 installed_apps 后出错
- angular - PanelMenuModule 与 ng-template 或 ng-container 的组合
- python - 我在哪里可以找到 selenium ActionBuilder 类的 python 源代码/文档?
- angularjs - 如何可视化 Angular.js 应用程序的组件层次结构?
- ios - 如何在使用桥接头时将数据(字典)从 Objective-C 控制器传递到 Swift `viewcontroller`?还有其他方法吗?
- oracle - 错误 ORA-29259:调用 utl_http.begin_request 到达输入结束
- java - 使用 Hibernate 将当前日期 (Java) 与数据库 (sql) 中的时间戳进行比较
- python - 将 Django 布尔值从默认值“False”更改为“No”