我想在bluez上启用调试消息

Sag*_* Sm 3 debugging ubuntu logging bluetooth bluez

我实际上是想弄清楚我在耳机上使用bluez进行音乐流时DBG(“”)打印的位置。所以基本上我想知道所有bluez调试消息在哪里打印,无论是哪种蓝牙操作。例如:扫描,查询,连接等。

希望有人可以帮助我。提前致谢 。

unn*_*nni 8

要添加到上面数据冰箱的答案中,我/usr/lib/systemd/system/bluetooth.service在带有 BlueZ 5.41 的 Ubuntu 16.04 中没有。

文件在/etc/systemd/system/bluetooth.target.wants/bluetooth.service,要修改的条目是

ExecStart=/usr/lib/bluez5/bluetooth/bluetoothd –d
Run Code Online (Sandbox Code Playgroud)

日志也可以使用

journalctl --unit=bluetooth -f
Run Code Online (Sandbox Code Playgroud)


小智 5

目前我这里没有Ubuntu,但这是它在Fedora上的工作方式,并且我确定它在Ubuntu上非常相似,尤其是systemd-part:

通过添加一个-dafter来启用调试

ExecStart=/usr/libexec/bluetooth/bluetoothd
Run Code Online (Sandbox Code Playgroud)

/usr/lib/systemd/system/bluetooth.service

保存,然后:

$ systemctl daemon-reload
$ systemctl restart bluetooth
Run Code Online (Sandbox Code Playgroud)

现在,您可以获取信息 /var/log/syslog