Diff between a2023bf5f899ca968d28be706ff040b95e3c19f7 and 29a4871ab80a67a1a7245d969fecf5e08d8ee7e0

Changed Files

File Additions Deletions Status
src/log.c +16 -0 modified
src/log.h +3 -0 modified

Full Patch

diff --git a/src/log.c b/src/log.c
index 6a20b68..d2a20de 100644
--- a/src/log.c
+++ b/src/log.c
@@ -180,6 +180,22 @@ void info(const char *format, ...)
 	va_end(ap);
 }
 
+void btd_log(uint16_t index, int priority, const char *format, ...)
+{
+	va_list ap;
+
+	va_start(ap, format);
+	vsyslog(priority, format, ap);
+	va_end(ap);
+
+	if (logging_fd < 0)
+		return;
+
+	va_start(ap, format);
+	logging_log(index, priority, format, ap);
+	va_end(ap);
+}
+
 void btd_error(uint16_t index, const char *format, ...)
 {
 	va_list ap;
diff --git a/src/log.h b/src/log.h
index f40fb31..0d243ce 100644
--- a/src/log.h
+++ b/src/log.h
@@ -27,6 +27,9 @@ 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, ...)
+					__attribute__((format(printf, 3, 4)));
+
 void btd_error(uint16_t index, const char *format, ...)
 					__attribute__((format(printf, 2, 3)));
 void btd_warn(uint16_t index, const char *format, ...)