]> git.proxmox.com Git - mirror_corosync.git/commitdiff
CTS: add logging to test agent
authorAngus Salkeld <asalkeld@redhat.com>
Wed, 8 Dec 2010 00:28:06 +0000 (11:28 +1100)
committerAngus Salkeld <asalkeld@redhat.com>
Tue, 9 Aug 2011 00:37:15 +0000 (10:37 +1000)
Reviewed-by: Steven Dake <sdake@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
cts/agents/cpg_test_agent.c

index e15748cf0100594cc4f3dbb45ea2ae0f76f57393..2295e1b35638a6a40bb2156ce102ab9719c2a6c6 100644 (file)
@@ -49,6 +49,7 @@
 
 #include <corosync/list.h>
 #include <qb/qbdefs.h>
+#include <qb/qbutil.h>
 #include <qb/qbloop.h>
 #include <corosync/cpg.h>
 #include <corosync/cfg.h>
@@ -737,11 +738,20 @@ static void do_command (int sock, char* func, char*args[], int num_args)
        }
 }
 
+static void cs_ipcs_libqb_log_fn(const char *file_name,
+       int32_t file_line,
+       int32_t severity,
+       const char *msg)
+{
+       syslog(severity, "%s:%d %s() %s", file_name, file_line, __func__, msg);
+}
+
 
 int main (int argc, char *argv[])
 {
        openlog (NULL, LOG_CONS|LOG_PID, LOG_DAEMON);
 
+       qb_util_set_log_function (cs_ipcs_libqb_log_fn);
        list_init (&msg_log_head);
        list_init (&config_chg_log_head);