summaryrefslogtreecommitdiff
path: root/src/log.h
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2020-04-29 14:01:12 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2020-05-01 13:44:02 -0700
commit5696806501e827de1765de7ade0c05bc922c03d6 (patch)
tree12a18b98a8a58b35bfae2a97525f8b596c0bb015 /src/log.h
parenta21b6a6c903303b5ac50f393aa857f3c40b4a6b3 (diff)
downloadbluez-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.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/log.h b/src/log.h
index 0d243ceca..e83431151 100644
--- a/src/log.h
+++ b/src/log.h
@@ -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)