diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-04-29 14:01:12 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-05-01 13:44:02 -0700 |
commit | 5696806501e827de1765de7ade0c05bc922c03d6 (patch) | |
tree | 12a18b98a8a58b35bfae2a97525f8b596c0bb015 /src/log.h | |
parent | a21b6a6c903303b5ac50f393aa857f3c40b4a6b3 (diff) | |
download | bluez-5696806501e827de1765de7ade0c05bc922c03d6.tar.gz |
log: Make error and warn log file and function information
This makes it a lot simpler to find out where errors/warnings come from
and also remove the possibility of clashes when having multiple places
where the message would be exactly the same.
Diffstat (limited to 'src/log.h')
-rw-r--r-- | src/log.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -23,8 +23,6 @@ #include <stdint.h> -void error(const char *format, ...) __attribute__((format(printf, 1, 2))); -void warn(const char *format, ...) __attribute__((format(printf, 1, 2))); void info(const char *format, ...) __attribute__((format(printf, 1, 2))); void btd_log(uint16_t index, int priority, const char *format, ...) @@ -71,3 +69,7 @@ void __btd_enable_debug(struct btd_debug_desc *start, } while (0) #define DBG(fmt, arg...) DBG_IDX(0xffff, fmt, ## arg) +#define error(fmt, arg...) \ + btd_error(0xffff, "%s:%s() " fmt, __FILE__, __func__, ## arg) +#define warn(fmt, arg...) \ + btd_warn(0xffff, "%s:%s() " fmt, __FILE__, __func__, ## arg) |