[PATCH 01/19] shared/tester: Add support for debug logs for tester

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It allows to print debug logs if debug mode is enabled. It could help in
case of additional debug prints need (verbose mode).
---
 src/shared/tester.c | 14 ++++++++++++++
 src/shared/tester.h |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/src/shared/tester.c b/src/shared/tester.c
index 56e5696..88dfaeb 100644
--- a/src/shared/tester.c
+++ b/src/shared/tester.c
@@ -134,6 +134,20 @@ void tester_print(const char *format, ...)
 	printf("%s\n", COLOR_OFF);
 }
 
+void tester_debug(const char *format, ...)
+{
+	va_list ap;
+
+	if (!tester_use_debug())
+		return;
+
+	printf("  %s", COLOR_WHITE);
+	va_start(ap, format);
+	vprintf(format, ap);
+	va_end(ap);
+	printf("%s\n", COLOR_OFF);
+}
+
 void tester_warn(const char *format, ...)
 {
 	va_list ap;
diff --git a/src/shared/tester.h b/src/shared/tester.h
index 85d5e95..0231f19 100644
--- a/src/shared/tester.h
+++ b/src/shared/tester.h
@@ -33,6 +33,8 @@ void tester_print(const char *format, ...)
 				__attribute__((format(printf, 1, 2)));
 void tester_warn(const char *format, ...)
 				__attribute__((format(printf, 1, 2)));
+void tester_debug(const char *format, ...)
+				__attribute__((format(printf, 1, 2)));
 
 typedef void (*tester_destroy_func_t)(void *user_data);
 typedef void (*tester_data_func_t)(const void *test_data);
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux