Bluetooth: Prefer printf over printk
The printf API has a much richer support for various format specifiers. Switch the Bluetooth logging macros to use printf instead of printk and make sure STDOUT_CONSOLE gets selected when BLUETOOTH_DEBUG is selected (so printf actually works). Change-Id: I9a9818d51a677c6c79a35fef6daca7979f61c78d Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
c533552497
commit
8930a13b60
2 changed files with 6 additions and 5 deletions
|
@ -32,20 +32,20 @@
|
|||
#ifndef __BT_BLUETOOTH_H
|
||||
#define __BT_BLUETOOTH_H
|
||||
|
||||
#include <misc/printk.h>
|
||||
#include <stdio.h>
|
||||
#include <bluetooth/buf.h>
|
||||
|
||||
/* Bluetooth subsystem logging helpers */
|
||||
|
||||
#if defined(CONFIG_BLUETOOTH_DEBUG)
|
||||
#define BT_DBG(fmt, ...) printk("bt: %s: " fmt, __func__, ##__VA_ARGS__)
|
||||
#define BT_DBG(fmt, ...) printf("bt: %s: " fmt, __func__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define BT_DBG(fmt, ...)
|
||||
#endif /* CONFIG_BLUETOOTH_DEBUG */
|
||||
|
||||
#define BT_ERR(fmt, ...) printk("bt: %s: " fmt, __func__, ##__VA_ARGS__)
|
||||
#define BT_WARN(fmt, ...) printk("bt: %s: " fmt, __func__, ##__VA_ARGS__)
|
||||
#define BT_INFO(fmt, ...) printk("bt: " fmt, ##__VA_ARGS__)
|
||||
#define BT_ERR(fmt, ...) printf("bt: %s: " fmt, __func__, ##__VA_ARGS__)
|
||||
#define BT_WARN(fmt, ...) printf("bt: %s: " fmt, __func__, ##__VA_ARGS__)
|
||||
#define BT_INFO(fmt, ...) printf("bt: " fmt, ##__VA_ARGS__)
|
||||
|
||||
/* HCI control APIs */
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ config BLUETOOTH_DEBUG
|
|||
bool
|
||||
prompt "Bluetooth LE debug support"
|
||||
depends on BLUETOOTH
|
||||
select STDOUT_CONSOLE
|
||||
default n
|
||||
help
|
||||
This option enables Bluetooth debug going to standard
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue