我实际上正在尝试弄清楚当我使用bluez将音乐流传输到我的耳机时,DBG("")打印消息将去往何方。因此,我想知道所有bluez调试消息的打印位置,无论是什么类型的蓝牙操作,例如: 扫描、查询、连接等。
希望有人能帮助我解决这个问题。 提前感谢。
目前我这里没有Ubuntu,但是在Fedora上它的工作方式如下,我确信在Ubuntu上非常相似,尤其是systemd部分:
通过在后面添加-d
来启用调试。
ExecStart=/usr/libexec/bluetooth/bluetoothd
在/usr/lib/systemd/system/bluetooth.service
中
保存后执行以下操作:
$ systemctl daemon-reload
$ systemctl restart bluetooth
现在您可以在 /var/log/syslog
中获取您的信息。
补充datafridge上面的答案,我的Ubuntu 16.04上没有/usr/lib/systemd/system/bluetooth.service
文件,但是有BlueZ 5.41。
这个文件在/etc/systemd/system/bluetooth.target.wants/bluetooth.service
,需要修改的条目是
ExecStart=/usr/lib/bluez5/bluetooth/bluetoothd –d
可以使用日志查看器来查看日志。
journalctl --unit=bluetooth -f
DBG
调用(内核?蓝牙守护进程?蓝牙客户端?)。但通常情况下,内核消息可以使用dmesg
查看,许多应用程序(包括 bluetoothd)记录到 syslog 中,这是一个文件,通常可以查看为/var/log/syslog
。 - kaylum