Update Log Tag
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 27 Jun 2013 05:06:13 +0000 (14:06 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 27 Jun 2013 05:06:13 +0000 (14:06 +0900)
Change-Id: Ic830d5000575d9cd14012589e040ecf2248d70d8

include/debug.h
packaging/libcom-core.spec
src/com-core.c
src/com-core_packet.c
src/com-core_thread.c

index d629ed5..dcb8d03 100644 (file)
@@ -28,8 +28,8 @@
 #endif
 
 #if !defined(FLOG)
-#define DbgPrint(format, arg...)       SECURE_LOGD("[\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
-#define ErrPrint(format, arg...)       SECURE_LOGE("[\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
+#define DbgPrint(format, arg...)       SECURE_LOGD(format, ##arg)
+#define ErrPrint(format, arg...)       SECURE_LOGE(format, ##arg)
 #else
 extern FILE *__file_log_fp;
 #define DbgPrint(format, arg...) do { fprintf(__file_log_fp, "[LOG] [\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
index 9507b1d..619e495 100644 (file)
@@ -1,6 +1,6 @@
 Name: libcom-core
 Summary: Library for the light-weight IPC 
-Version: 0.4.1
+Version: 0.4.2
 Release: 1
 Group: HomeTF/Framework
 License: Apache License
index 7aa172e..1fb3c48 100644 (file)
@@ -134,19 +134,18 @@ static gboolean accept_cb(GIOChannel *src, GIOCondition cond, gpointer cbdata)
        }
 
        if ((cond & G_IO_ERR) || (cond & G_IO_HUP) || (cond & G_IO_NVAL)) {
-               DbgPrint("Client connection is lost\n");
+               ErrPrint("Client connection is lost\n");
                secure_socket_destroy_handle(socket_fd);
                free(cbdata);
                return FALSE;
        }
 
-       DbgPrint("New connectino arrived: socket(%d)\n", socket_fd);
        client_fd = secure_socket_get_connection_handle(socket_fd);
        if (client_fd < 0) {
                free(cbdata);
                return FALSE;
        }
-       DbgPrint("New client: %d\n", client_fd);
+       DbgPrint("New connectino arrived: server(%d), client(%d)\n", socket_fd, client_fd);
 
        if (fcntl(client_fd, F_SETFD, FD_CLOEXEC) < 0)
                ErrPrint("Error: %s\n", strerror(errno));
@@ -182,7 +181,6 @@ static gboolean accept_cb(GIOChannel *src, GIOCondition cond, gpointer cbdata)
        g_io_channel_unref(gio);
 
        invoke_con_cb_list(client_fd);
-       DbgPrint("New client is connected with %d\n", client_fd);
        return TRUE;
 }
 
@@ -214,7 +212,7 @@ EAPI int com_core_server_create(const char *addr, int is_sync, int (*service_cb)
        if (!is_sync && fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
                ErrPrint("fcntl: %s\n", strerror(errno));
 
-       DbgPrint("Create new IO channel for socket FD: %d\n", fd);
+       DbgPrint("Create new IO channel for server FD: %d\n", fd);
        gio = g_io_channel_unix_new(fd);
        if (!gio) {
                ErrPrint("Failed to create new io channel\n");
index d6189df..4869cc9 100644 (file)
@@ -471,8 +471,6 @@ EAPI struct packet *com_core_packet_oneshot_send(const char *addr, struct packet
        if (fd < 0)
                return NULL;
 
-       DbgPrint("FD: %d\n", fd);
-
        if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
                ErrPrint("fcntl: %s\n", strerror(errno));
 
@@ -483,8 +481,6 @@ EAPI struct packet *com_core_packet_oneshot_send(const char *addr, struct packet
        if (ret < 0)
                goto out;
 
-       DbgPrint("Sent: %d bytes (%d bytes)\n", ret, packet_size(packet));
-
        ptr = malloc(packet_header_size());
        if (!ptr) {
                ErrPrint("Heap: %s\n", strerror(errno));
@@ -509,7 +505,6 @@ EAPI struct packet *com_core_packet_oneshot_send(const char *addr, struct packet
        }
 
        size = packet_payload_size(result);
-       DbgPrint("Payload size: %d\n", size);
        if (size < 0) {
                packet_destroy(result);
                result = NULL;
index 4f0b12b..7b5655e 100644 (file)
@@ -437,12 +437,12 @@ static gboolean evt_pipe_cb(GIOChannel *src, GIOCondition cond, gpointer data)
        }
 
        if (!(cond & G_IO_IN)) {
-               DbgPrint("PIPE is not valid\n");
+               ErrPrint("PIPE is not valid\n");
                goto errout;
        }
 
        if ((cond & G_IO_ERR) || (cond & G_IO_HUP) || (cond & G_IO_NVAL)) {
-               DbgPrint("PIPE is not valid\n");
+               ErrPrint("PIPE is not valid\n");
                goto errout;
        }
 
@@ -512,7 +512,7 @@ static inline struct tcb *tcb_create(int client_fd, int is_sync, int (*service_c
                return NULL;
        }
 
-       DbgPrint("[%d] New TCB created: %d, %d\n", client_fd, tcb->evt_pipe[PIPE_READ], tcb->evt_pipe[PIPE_WRITE]);
+       DbgPrint("[%d] New TCB created: R(%d), W(%d)\n", client_fd, tcb->evt_pipe[PIPE_READ], tcb->evt_pipe[PIPE_WRITE]);
        return tcb;
 }
 
@@ -542,7 +542,6 @@ static gboolean accept_cb(GIOChannel *src, GIOCondition cond, gpointer data)
                return FALSE;
        }
 
-       DbgPrint("New connection is made: socket(%d)\n", socket_fd);
        fd = secure_socket_get_connection_handle(socket_fd);
        if (fd < 0) {
                ErrPrint("Failed to get client fd from socket\n");
@@ -550,7 +549,6 @@ static gboolean accept_cb(GIOChannel *src, GIOCondition cond, gpointer data)
                return FALSE;
        }
 
-       DbgPrint("New client: %d\n", fd);
        if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
                ErrPrint("Error: %s\n", strerror(errno));
 
@@ -596,7 +594,6 @@ static gboolean accept_cb(GIOChannel *src, GIOCondition cond, gpointer data)
        }
        g_io_channel_unref(gio);
 
-       DbgPrint("New client is connected with %d\n", tcb->handle);
        invoke_con_cb_list(tcb->handle);
 
        ret = pthread_create(&tcb->thid, NULL, client_cb, tcb);
@@ -671,7 +668,6 @@ EAPI int com_core_thread_client_create(const char *addr, int is_sync, int (*serv
 
        g_io_channel_unref(gio);
 
-       DbgPrint("New client is connected with %d\n", client_fd);
        invoke_con_cb_list(tcb->handle);
 
        ret = pthread_create(&tcb->thid, NULL, client_cb, tcb);