Init logging handlers in client.
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Sun, 27 Nov 2011 22:26:59 +0000 (14:26 -0800)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Sun, 27 Nov 2011 22:26:59 +0000 (14:26 -0800)
src/daemon.c

index bd30a8e..5367552 100644 (file)
@@ -60,6 +60,14 @@ typedef struct client_thread_data {
 } client_thread_data;
 
 
+void __guacd_log_info(guac_client* client, const char* format, va_list args) {
+    vsyslog(LOG_INFO, format, args);
+}
+
+void __guacd_log_error(guac_client* client, const char* format, va_list args) {
+    vsyslog(LOG_ERR, format, args);
+}
+
 void* start_client_thread(void* data) {
 
     guac_client* client;
@@ -170,6 +178,10 @@ void* start_client_thread(void* data) {
         return NULL;
     }
 
+    /* Set up logging in client */
+    client->log_info_handler  = __guacd_log_info;
+    client->log_error_handler = __guacd_log_error;
+
     /* Start client threads */
     syslog(LOG_INFO, "Starting client");
     if (guac_start_client(client))