Introduce macros to display debug messages.
[geeqie.git] / src / remote.c
index 6dc956a..dce5ec4 100644 (file)
@@ -97,12 +97,8 @@ static gboolean remote_server_client_cb(GIOChannel *source, GIOCondition conditi
                {
                rc->clients = g_list_remove(rc->clients, client);
 
-               if (debug)
-                       {
-                       printf("HUP detected, closing client.\n");
-                       printf("client count %d\n", g_list_length(rc->clients));
-                       }
-
+               DEBUG_1("HUP detected, closing client.\nclient count %d\n", g_list_length(rc->clients));
+               
                g_source_remove(client->channel_id);
                close(client->fd);
                g_free(client);
@@ -133,7 +129,7 @@ static void remote_server_client_add(RemoteConnection *rc, int fd)
        g_io_channel_unref(channel);
 
        rc->clients = g_list_append(rc->clients, client);
-       if (debug) printf("client count %d\n", g_list_length(rc->clients));
+       DEBUG_1("client count %d\n", g_list_length(rc->clients));
 }
 
 static void remote_server_clients_close(RemoteConnection *rc)
@@ -256,7 +252,7 @@ RemoteConnection *remote_client_open(const gchar *path)
        strncpy(addr.sun_path, path, sun_path_len);
        if (connect(fd, &addr, sizeof(addr)) == -1)
                {
-               if (debug) printf("error connecting to socket: %s\n", strerror(errno));
+               DEBUG_1("error connecting to socket: %s\n", strerror(errno));
                close(fd);
                return NULL;
                }