[PATCH 2/5] TEST: add logging to testcpg and testevs

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

 



Signed-off-by: Angus Salkeld <asalkeld@xxxxxxxxxx>
---
 test/testcpg.c |    9 +++++++++
 test/testevs.c |    9 +++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/test/testcpg.c b/test/testcpg.c
index 016b67f..85d4ac5 100644
--- a/test/testcpg.c
+++ b/test/testcpg.c
@@ -51,6 +51,8 @@
 #include <corosync/cpg.h>
 #include <corosync/swab.h>
 
+#include <qb/qblog.h>
+
 static int quit = 0;
 static int show_ip = 0;
 
@@ -203,6 +205,13 @@ int main (int argc, char *argv[]) {
 	int member_list_entries;
 	int i;
 
+	qb_log_init("testcpg", LOG_USER, LOG_ERR);
+	qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_ENABLED, QB_FALSE);
+	qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD,
+			  QB_LOG_FILTER_FILE, "*", LOG_TRACE);
+	qb_log_ctl(QB_LOG_STDERR, QB_LOG_CONF_ENABLED, QB_TRUE);
+	qb_log_format_set(QB_LOG_STDERR, "[%p] %f %b");
+
 	while ( (opt = getopt(argc, argv, options)) != -1 ) {
 		switch (opt) {
 		case 'i':
diff --git a/test/testevs.c b/test/testevs.c
index b738c9a..0730ac6 100644
--- a/test/testevs.c
+++ b/test/testevs.c
@@ -44,6 +44,8 @@
 #include <corosync/corotypes.h>
 #include <corosync/evs.h>
 
+#include <qb/qblog.h>
+
 static const char *delivery_string;
 
 static int deliveries = 0;
@@ -111,6 +113,13 @@ int main (void)
 	unsigned int local_nodeid;
 	size_t member_list_entries = 32;
 
+	qb_log_init("testevs", LOG_USER, LOG_ERR);
+	qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_ENABLED, QB_FALSE);
+	qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD,
+			  QB_LOG_FILTER_FILE, "*", LOG_TRACE);
+	qb_log_ctl(QB_LOG_STDERR, QB_LOG_CONF_ENABLED, QB_TRUE);
+	qb_log_format_set(QB_LOG_STDERR, "[%p] %f %b");
+
 	result = evs_initialize (&handle, &callbacks);
 	if (result != CS_OK) {
 		printf ("Couldn't initialize EVS service %d\n", result);
-- 
1.7.7.6

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux