sensord: change macros for log 46/59346/1
authorkibak.yoon <kibak.yoon@samsung.com>
Sat, 13 Feb 2016 05:48:24 +0000 (14:48 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Sat, 13 Feb 2016 05:48:24 +0000 (14:48 +0900)
- use _E/_I/_D/_W

Change-Id: Ibd73416a4e00a8c739d4793f5ecded6c2f4e7fc3
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
35 files changed:
src/client/client.cpp
src/client/client_common.cpp
src/client/command_channel.cpp
src/client/sensor_client_info.cpp
src/client/sensor_event_listener.cpp
src/client/sensor_handle_info.cpp
src/server/client_info_manager.cpp
src/server/client_sensor_record.cpp
src/server/command_worker.cpp
src/server/main.cpp
src/server/permission_checker.cpp
src/server/physical_sensor.cpp
src/server/plugins/auto_rotation/auto_rotation_sensor.cpp
src/server/plugins/fusion/fusion_sensor.cpp
src/server/plugins/gravity/gravity_sensor.cpp
src/server/plugins/linear_accel/linear_accel_sensor.cpp
src/server/plugins/orientation/orientation_sensor.cpp
src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp
src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp
src/server/plugins/rotation_vector/rv/rv_sensor.cpp
src/server/plugins/tilt/tilt_sensor.cpp
src/server/sensor_base.cpp
src/server/sensor_event_dispatcher.cpp
src/server/sensor_event_poller.cpp
src/server/sensor_event_queue.cpp
src/server/sensor_loader.cpp
src/server/sensor_usage.cpp
src/server/server.cpp
src/server/virtual_sensor_config.cpp
src/server/worker_thread.cpp
src/shared/cbase_lock.cpp
src/shared/csocket.cpp
src/shared/poller.cpp
src/shared/sensor_info.cpp
src/shared/sensor_logs.h

index 3dcf35a..abd7d9f 100644 (file)
@@ -62,7 +62,7 @@ void init_client(void)
 
 static void good_bye(void)
 {
-       DBG("Good bye! %s\n", get_client_name());
+       _D("Good bye! %s\n", get_client_name());
        clean_up();
 }
 
@@ -71,14 +71,14 @@ static int g_power_save_state_cb_cnt = 0;
 static void set_power_save_state_cb(void)
 {
        if (g_power_save_state_cb_cnt < 0)
-               ERR("g_power_save_state_cb_cnt(%d) is wrong", g_power_save_state_cb_cnt);
+               _E("g_power_save_state_cb_cnt(%d) is wrong", g_power_save_state_cb_cnt);
 
        ++g_power_save_state_cb_cnt;
 
        if (g_power_save_state_cb_cnt == 1) {
-               DBG("Power save callback is registered");
+               _D("Power save callback is registered");
                g_power_save_state = get_power_save_state();
-               DBG("power_save_state = [%d]", g_power_save_state);
+               _D("power_save_state = [%d]", g_power_save_state);
                vconf_notify_key_changed(VCONFKEY_PM_STATE, power_save_state_cb, NULL);
        }
 }
@@ -88,10 +88,10 @@ static void unset_power_save_state_cb(void)
        --g_power_save_state_cb_cnt;
 
        if (g_power_save_state_cb_cnt < 0)
-               ERR("g_power_save_state_cb_cnt(%d) is wrong", g_power_save_state_cb_cnt);
+               _E("g_power_save_state_cb_cnt(%d) is wrong", g_power_save_state_cb_cnt);
 
        if (g_power_save_state_cb_cnt == 0) {
-               DBG("Power save callback is unregistered");
+               _D("Power save callback is unregistered");
                vconf_ignore_key_changed(VCONFKEY_PM_STATE, power_save_state_cb);
        }
 }
@@ -135,12 +135,12 @@ static void power_save_state_cb(keynode_t *node, void *data)
        cur_power_save_state = get_power_save_state();
 
        if (cur_power_save_state == g_power_save_state) {
-               DBG("g_power_save_state NOT changed : [%d]", cur_power_save_state);
+               _D("g_power_save_state NOT changed : [%d]", cur_power_save_state);
                return;
        }
 
        g_power_save_state = cur_power_save_state;
-       DBG("power_save_state: %d noti to %s", g_power_save_state, get_client_name());
+       _D("power_save_state: %d noti to %s", g_power_save_state, get_client_name());
 
        client_info.get_listening_sensors(sensors);
 
@@ -161,7 +161,7 @@ static void restore_session(void)
 {
        AUTOLOCK(lock);
 
-       INFO("Trying to restore session for %s", get_client_name());
+       _I("Trying to restore session for %s", get_client_name());
 
        command_channel *cmd_channel;
        int client_id;
@@ -182,7 +182,7 @@ static void restore_session(void)
                retm_if (!cmd_channel, "Failed to allocate memory");
 
                if (!cmd_channel->create_channel()) {
-                       ERR("%s failed to create command channel for %s", get_client_name(), get_sensor_name(*it_sensor));
+                       _E("%s failed to create command channel for %s", get_client_name(), get_sensor_name(*it_sensor));
                        delete cmd_channel;
                        goto FAILED;
                }
@@ -192,7 +192,7 @@ static void restore_session(void)
                if (first_connection) {
                        first_connection = false;
                        if (!cmd_channel->cmd_get_id(client_id)) {
-                               ERR("Failed to get client id");
+                               _E("Failed to get client id");
                                goto FAILED;
                        }
 
@@ -203,7 +203,7 @@ static void restore_session(void)
                cmd_channel->set_client_id(client_id);
 
                if (!cmd_channel->cmd_hello(*it_sensor)) {
-                       ERR("Sending cmd_hello(%s, %d) failed for %s", get_sensor_name(*it_sensor), client_id, get_client_name());
+                       _E("Sending cmd_hello(%s, %d) failed for %s", get_sensor_name(*it_sensor), client_id, get_client_name());
                        goto FAILED;
                }
 
@@ -214,20 +214,20 @@ static void restore_session(void)
 
                client_info.get_sensor_rep(*it_sensor, cur_rep);
                if (!change_sensor_rep(*it_sensor, prev_rep, cur_rep)) {
-                       ERR("Failed to change rep(%s) for %s", get_sensor_name(*it_sensor), get_client_name());
+                       _E("Failed to change rep(%s) for %s", get_sensor_name(*it_sensor), get_client_name());
                        goto FAILED;
                }
 
                ++it_sensor;
        }
 
-       INFO("Succeeded to restore session for %s", get_client_name());
+       _I("Succeeded to restore session for %s", get_client_name());
 
        return;
 
 FAILED:
        event_listener.clear();
-       ERR("Failed to restore session for %s", get_client_name());
+       _E("Failed to restore session for %s", get_client_name());
 }
 
 static bool get_events_diff(event_type_vector &a_vec, event_type_vector &b_vec, event_type_vector &add_vec, event_type_vector &del_vec)
@@ -249,7 +249,7 @@ static bool change_sensor_rep(sensor_id_t sensor_id, sensor_rep &prev_rep, senso
        event_type_vector add_event_types, del_event_types;
 
        if (!client_info.get_command_channel(sensor_id, &cmd_channel)) {
-               ERR("client %s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
+               _E("client %s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
                return false;
        }
 
@@ -261,21 +261,21 @@ static bool change_sensor_rep(sensor_id_t sensor_id, sensor_rep &prev_rep, senso
        if (cur_rep.active) {
                if (prev_rep.option != cur_rep.option) {
                        if (!cmd_channel->cmd_set_option(cur_rep.option)) {
-                               ERR("Sending cmd_set_option(%d, %s, %d) failed for %s", client_id, get_sensor_name(sensor_id), cur_rep.option, get_client_name());
+                               _E("Sending cmd_set_option(%d, %s, %d) failed for %s", client_id, get_sensor_name(sensor_id), cur_rep.option, get_client_name());
                                return false;
                        }
                }
 
                if ( (prev_rep.interval != cur_rep.interval) || (prev_rep.latency != cur_rep.latency)) {
                        if (!cmd_channel->cmd_set_batch(cur_rep.interval, cur_rep.latency)) {
-                               ERR("Sending cmd_set_batch(%d, %s, %d, %d) failed for %s", client_id, get_sensor_name(sensor_id), cur_rep.interval, cur_rep.latency, get_client_name());
+                               _E("Sending cmd_set_batch(%d, %s, %d, %d) failed for %s", client_id, get_sensor_name(sensor_id), cur_rep.interval, cur_rep.latency, get_client_name());
                                return false;
                        }
                }
 
                if (!add_event_types.empty()) {
                        if (!cmd_channel->cmd_register_events(add_event_types)) {
-                               ERR("Sending cmd_register_events(%d, add_event_types) failed for %s", client_id, get_client_name());
+                               _E("Sending cmd_register_events(%d, add_event_types) failed for %s", client_id, get_client_name());
                                return false;
                        }
                }
@@ -284,7 +284,7 @@ static bool change_sensor_rep(sensor_id_t sensor_id, sensor_rep &prev_rep, senso
 
        if (prev_rep.active && !del_event_types.empty()) {
                if (!cmd_channel->cmd_unregister_events(del_event_types)) {
-                       ERR("Sending cmd_unregister_events(%d, del_event_types) failed for %s", client_id, get_client_name());
+                       _E("Sending cmd_unregister_events(%d, del_event_types) failed for %s", client_id, get_client_name());
                        return false;
                }
        }
@@ -292,17 +292,17 @@ static bool change_sensor_rep(sensor_id_t sensor_id, sensor_rep &prev_rep, senso
        if (prev_rep.active != cur_rep.active) {
                if (cur_rep.active) {
                        if (!cmd_channel->cmd_start()) {
-                               ERR("Sending cmd_start(%d, %s) failed for %s", client_id, get_sensor_name(sensor_id), get_client_name());
+                               _E("Sending cmd_start(%d, %s) failed for %s", client_id, get_sensor_name(sensor_id), get_client_name());
                                return false;
                        }
                } else {
                        if (!cmd_channel->cmd_unset_batch()) {
-                               ERR("Sending cmd_unset_interval(%d, %s) failed for %s", client_id, get_sensor_name(sensor_id), get_client_name());
+                               _E("Sending cmd_unset_interval(%d, %s) failed for %s", client_id, get_sensor_name(sensor_id), get_client_name());
                                return false;
                        }
 
                        if (!cmd_channel->cmd_stop()) {
-                               ERR("Sending cmd_stop(%d, %s) failed for %s", client_id, get_sensor_name(sensor_id), get_client_name());
+                               _E("Sending cmd_stop(%d, %s) failed for %s", client_id, get_sensor_name(sensor_id), get_client_name());
                                return false;
                        }
                }
@@ -322,7 +322,7 @@ static bool get_sensor_list(void)
                command_channel cmd_channel;
 
                if (!cmd_channel.create_channel()) {
-                       ERR("%s failed to create command channel", get_client_name());
+                       _E("%s failed to create command channel", get_client_name());
                        return false;
                }
 
@@ -542,7 +542,7 @@ API int sensord_connect(sensor_t sensor)
 
        handle = client_info.create_handle(sensor_id);
        if (handle == MAX_HANDLE_REACHED) {
-               ERR("Maximum number of handles reached, sensor: %s in client %s", get_sensor_name(sensor_id), get_client_name());
+               _E("Maximum number of handles reached, sensor: %s in client %s", get_sensor_name(sensor_id), get_client_name());
                return OP_ERROR;
        }
 
@@ -551,7 +551,7 @@ API int sensord_connect(sensor_t sensor)
                retvm_if (!cmd_channel, OP_ERROR, "Failed to allocate memory");
 
                if (!cmd_channel->create_channel()) {
-                       ERR("%s failed to create command channel for %s", get_client_name(), get_sensor_name(sensor_id));
+                       _E("%s failed to create command channel for %s", get_client_name(), get_sensor_name(sensor_id));
                        client_info.delete_handle(handle);
                        delete cmd_channel;
                        return OP_ERROR;
@@ -561,7 +561,7 @@ API int sensord_connect(sensor_t sensor)
        }
 
        if (!client_info.get_command_channel(sensor_id, &cmd_channel)) {
-               ERR("%s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
+               _E("%s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
                client_info.delete_handle(handle);
                return OP_ERROR;
        }
@@ -569,28 +569,28 @@ API int sensord_connect(sensor_t sensor)
        if (!client_info.has_client_id()) {
                first_connection = true;
                if(!cmd_channel->cmd_get_id(client_id)) {
-                       ERR("Sending cmd_get_id() failed for %s", get_sensor_name(sensor_id));
+                       _E("Sending cmd_get_id() failed for %s", get_sensor_name(sensor_id));
                        client_info.close_command_channel(sensor_id);
                        client_info.delete_handle(handle);
                        return OP_ERROR;
                }
 
                client_info.set_client_id(client_id);
-               INFO("%s gets client_id [%d]", get_client_name(), client_id);
+               _I("%s gets client_id [%d]", get_client_name(), client_id);
                event_listener.start_event_listener();
-               INFO("%s starts listening events with client_id [%d]", get_client_name(), client_id);
+               _I("%s starts listening events with client_id [%d]", get_client_name(), client_id);
        }
 
        client_id = client_info.get_client_id();
        cmd_channel->set_client_id(client_id);
 
-       INFO("%s[%d] connects with %s[%d]", get_client_name(), client_id, get_sensor_name(sensor_id), handle);
+       _I("%s[%d] connects with %s[%d]", get_client_name(), client_id, get_sensor_name(sensor_id), handle);
 
        client_info.set_sensor_params(handle, SENSOR_STATE_STOPPED, SENSOR_OPTION_DEFAULT);
 
        if (!sensor_registered) {
                if(!cmd_channel->cmd_hello(sensor_id)) {
-                       ERR("Sending cmd_hello(%s, %d) failed for %s", get_sensor_name(sensor_id), client_id, get_client_name());
+                       _E("Sending cmd_hello(%s, %d) failed for %s", get_sensor_name(sensor_id), client_id, get_client_name());
                        client_info.close_command_channel(sensor_id);
                        client_info.delete_handle(handle);
                        if (first_connection) {
@@ -616,22 +616,22 @@ API bool sensord_disconnect(int handle)
 
        if (!client_info.get_sensor_state(handle, sensor_state)||
                !client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
        if (!client_info.get_command_channel(sensor_id, &cmd_channel)) {
-               ERR("client %s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
+               _E("client %s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
                return false;
        }
 
        client_id = client_info.get_client_id();
        retvm_if ((client_id < 0), false, "Invalid client id : %d, handle: %d, %s, %s", client_id, handle, get_sensor_name(sensor_id), get_client_name());
 
-       INFO("%s disconnects with %s[%d]", get_client_name(), get_sensor_name(sensor_id), handle);
+       _I("%s disconnects with %s[%d]", get_client_name(), get_sensor_name(sensor_id), handle);
 
        if (sensor_state != SENSOR_STATE_STOPPED) {
-               WARN("%s[%d] for %s is not stopped before disconnecting.",
+               _W("%s[%d] for %s is not stopped before disconnecting.",
                        get_sensor_name(sensor_id), handle, get_client_name());
                sensord_stop(handle);
        }
@@ -644,14 +644,14 @@ API bool sensord_disconnect(int handle)
 
        if (!client_info.is_sensor_registered(sensor_id)) {
                if(!cmd_channel->cmd_byebye()) {
-                       ERR("Sending cmd_byebye(%d, %s) failed for %s", client_id, get_sensor_name(sensor_id), get_client_name());
+                       _E("Sending cmd_byebye(%d, %s) failed for %s", client_id, get_sensor_name(sensor_id), get_client_name());
                        return false;
                }
                client_info.close_command_channel(sensor_id);
        }
 
        if (!client_info.is_active()) {
-               INFO("Stop listening events for client %s with client id [%d]", get_client_name(), client_info.get_client_id());
+               _I("Stop listening events for client %s with client id [%d]", get_client_name(), client_info.get_client_id());
                event_listener.stop_event_listener();
        }
 
@@ -672,14 +672,14 @@ static bool register_event(int handle, unsigned int event_type, unsigned int int
        AUTOLOCK(lock);
 
        if (!client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
        if (interval == 0)
                interval = DEFAULT_INTERVAL;
 
-       INFO("%s registers event %s[0x%x] for sensor %s[%d] with interval: %d, latency: %d,  cb: 0x%x, user_data: 0x%x",
+       _I("%s registers event %s[0x%x] for sensor %s[%d] with interval: %d, latency: %d,  cb: 0x%x, user_data: 0x%x",
                get_client_name(), get_event_name(event_type), event_type, get_sensor_name(sensor_id),
                handle, interval, max_batch_latency, cb, user_data);
 
@@ -718,18 +718,18 @@ API bool sensord_unregister_event(int handle, unsigned int event_type)
        AUTOLOCK(lock);
 
        if (!client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
-       INFO("%s unregisters event %s[0x%x] for sensor %s[%d]", get_client_name(), get_event_name(event_type),
+       _I("%s unregisters event %s[0x%x] for sensor %s[%d]", get_client_name(), get_event_name(event_type),
                event_type, get_sensor_name(sensor_id), handle);
 
        client_info.get_sensor_rep(sensor_id, prev_rep);
        client_info.get_event_info(handle, event_type, prev_interval, prev_latency, prev_cb_type, prev_cb, prev_user_data);
 
        if (!client_info.unregister_event(handle, event_type)) {
-               ERR("%s try to unregister non registered event %s[0x%x] for sensor %s[%d]",
+               _E("%s try to unregister non registered event %s[0x%x] for sensor %s[%d]",
                        get_client_name(),get_event_name(event_type), event_type, get_sensor_name(sensor_id), handle);
                return false;
        }
@@ -754,12 +754,12 @@ API bool sensord_register_accuracy_cb(int handle, sensor_accuracy_changed_cb_t c
        AUTOLOCK(lock);
 
        if (!client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
 
-       INFO("%s registers accuracy_changed_cb for sensor %s[%d] with cb: 0x%x, user_data: 0x%x",
+       _I("%s registers accuracy_changed_cb for sensor %s[%d] with cb: 0x%x, user_data: 0x%x",
                get_client_name(), get_sensor_name(sensor_id), handle, cb, user_data);
 
        client_info.register_accuracy_cb(handle, cb , user_data);
@@ -775,12 +775,12 @@ API bool sensord_unregister_accuracy_cb(int handle)
        AUTOLOCK(lock);
 
        if (!client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
 
-       INFO("%s unregisters accuracy_changed_cb for sensor %s[%d]",
+       _I("%s unregisters accuracy_changed_cb for sensor %s[%d]",
                get_client_name(), get_sensor_name(sensor_id), handle);
 
        client_info.unregister_accuracy_cb(handle);
@@ -799,14 +799,14 @@ API bool sensord_start(int handle, int option)
        AUTOLOCK(lock);
 
        if (!client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
        retvm_if ((option < 0) || (option >= SENSOR_OPTION_END), false, "Invalid option value : %d, handle: %d, %s, %s",
                option, handle, get_sensor_name(sensor_id), get_client_name());
 
-       INFO("%s starts %s[%d], with option: %d, power save state: %d", get_client_name(), get_sensor_name(sensor_id),
+       _I("%s starts %s[%d], with option: %d, power save state: %d", get_client_name(), get_sensor_name(sensor_id),
                handle, option, g_power_save_state);
 
        if (g_power_save_state && !(g_power_save_state & option)) {
@@ -840,7 +840,7 @@ API bool sensord_stop(int handle)
 
        if (!client_info.get_sensor_state(handle, sensor_state)||
                !client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
@@ -848,7 +848,7 @@ API bool sensord_stop(int handle)
                get_client_name(), get_sensor_name(sensor_id), handle);
 
 
-       INFO("%s stops sensor %s[%d]", get_client_name(), get_sensor_name(sensor_id), handle);
+       _I("%s stops sensor %s[%d]", get_client_name(), get_sensor_name(sensor_id), handle);
 
        client_info.get_sensor_rep(sensor_id, prev_rep);
        client_info.get_sensor_params(handle, prev_state, prev_option);
@@ -877,11 +877,11 @@ static bool change_event_batch(int handle, unsigned int event_type, unsigned int
        AUTOLOCK(lock);
 
        if (!client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
-       INFO("%s changes batch of event %s[0x%x] for %s[%d] to (%d, %d)", get_client_name(), get_event_name(event_type),
+       _I("%s changes batch of event %s[0x%x] for %s[%d] to (%d, %d)", get_client_name(), get_event_name(event_type),
                        event_type, get_sensor_name(sensor_id), handle, interval, latency);
 
        client_info.get_sensor_rep(sensor_id, prev_rep);
@@ -914,11 +914,11 @@ API bool sensord_change_event_interval(int handle, unsigned int event_type, unsi
        AUTOLOCK(lock);
 
        if (!client_info.get_event_info(handle, event_type, prev_interval, prev_latency, prev_cb_type, prev_cb, prev_user_data)) {
-               ERR("Failed to get event info with handle = %d, event_type = 0x%x", handle, event_type);
+               _E("Failed to get event info with handle = %d, event_type = 0x%x", handle, event_type);
                return false;
        }
 
-       INFO("handle = %d, event_type = 0x%x, interval = %d, prev_latency = %d", handle, event_type, interval, prev_latency);
+       _I("handle = %d, event_type = 0x%x, interval = %d, prev_latency = %d", handle, event_type, interval, prev_latency);
        return change_event_batch(handle, event_type, interval, prev_latency);
 }
 
@@ -932,7 +932,7 @@ API bool sensord_change_event_max_batch_latency(int handle, unsigned int event_t
        AUTOLOCK(lock);
 
        if (!client_info.get_event_info(handle, event_type, prev_interval, prev_latency, prev_cb_type, prev_cb, prev_user_data)) {
-               ERR("Failed to get event info with handle = %d, event_type = 0x%x", handle, event_type);
+               _E("Failed to get event info with handle = %d, event_type = 0x%x", handle, event_type);
                return false;
        }
 
@@ -944,11 +944,11 @@ API bool sensord_change_event_maincontext(int handle, unsigned int event_type, G
        AUTOLOCK(lock);
 
        if (!client_info.set_event_maincontext(handle, event_type, maincontext)) {
-               ERR("Failed to get event info with handle = %d, event_type = 0x%x, maincontext = 0x%x", handle, event_type, maincontext);
+               _E("Failed to get event info with handle = %d, event_type = 0x%x, maincontext = 0x%x", handle, event_type, maincontext);
                return false;
        }
 
-       INFO("handle = %d, event_type = 0x%x, maincontext = 0x%x", handle, event_type, maincontext);
+       _I("handle = %d, event_type = 0x%x, maincontext = 0x%x", handle, event_type, maincontext);
        return true;
 }
 
@@ -964,7 +964,7 @@ API bool sensord_set_option(int handle, int option)
 
        if (!client_info.get_sensor_state(handle, sensor_state)||
                !client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
@@ -1002,7 +1002,7 @@ API bool sensord_set_wakeup(int handle, int wakeup)
        AUTOLOCK(lock);
 
        if (!client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
@@ -1012,7 +1012,7 @@ API bool sensord_set_wakeup(int handle, int wakeup)
        client_info.set_sensor_wakeup(handle, wakeup);
 
        if (!client_info.get_command_channel(sensor_id, &cmd_channel)) {
-               ERR("client %s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
+               _E("client %s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
                return false;
        }
 
@@ -1020,7 +1020,7 @@ API bool sensord_set_wakeup(int handle, int wakeup)
        retvm_if ((client_id < 0), false, "Invalid client id : %d, handle: %d, %s, %s", client_id, handle, get_sensor_name(sensor_id), get_client_name());
 
        if (!cmd_channel->cmd_set_wakeup(wakeup)) {
-               ERR("Sending cmd_set_wakeup(%d, %s, %d) failed for %s", client_id, get_sensor_name(sensor_id), wakeup, get_client_name());
+               _E("Sending cmd_set_wakeup(%d, %s, %d) failed for %s", client_id, get_sensor_name(sensor_id), wakeup, get_client_name());
                return false;
        }
 
@@ -1036,12 +1036,12 @@ API bool sensord_set_attribute_int(int handle, int attribute, int value)
        AUTOLOCK(lock);
 
        if (!client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
        if (!client_info.get_command_channel(sensor_id, &cmd_channel)) {
-               ERR("client %s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
+               _E("client %s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
                return false;
        }
 
@@ -1051,7 +1051,7 @@ API bool sensord_set_attribute_int(int handle, int attribute, int value)
                        client_id, handle, get_sensor_name(sensor_id), get_client_name());
 
        if (!cmd_channel->cmd_set_attribute_int(attribute, value)) {
-               ERR("Sending cmd_set_attribute_int(%d, %d) failed for %s",
+               _E("Sending cmd_set_attribute_int(%d, %d) failed for %s",
                        client_id, value, get_client_name);
                return false;
        }
@@ -1068,12 +1068,12 @@ API bool sensord_set_attribute_str(int handle, int attribute, const char *value,
        AUTOLOCK(lock);
 
        if (!client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
        if (!client_info.get_command_channel(sensor_id, &cmd_channel)) {
-               ERR("client %s failed to get command channel for %s",
+               _E("client %s failed to get command channel for %s",
                        get_client_name(), get_sensor_name(sensor_id));
                return false;
        }
@@ -1088,7 +1088,7 @@ API bool sensord_set_attribute_str(int handle, int attribute, const char *value,
                        client_id, handle, get_sensor_name(sensor_id), get_client_name());
 
        if (!cmd_channel->cmd_set_attribute_str(attribute, value, value_len)) {
-               ERR("Sending cmd_set_attribute_str(%d, %d, 0x%x) failed for %s",
+               _E("Sending cmd_set_attribute_str(%d, %d, 0x%x) failed for %s",
                        client_id, value_len, value, get_client_name);
                return false;
        }
@@ -1114,12 +1114,12 @@ API bool sensord_get_data(int handle, unsigned int data_id, sensor_data_t* senso
 
        if (!client_info.get_sensor_state(handle, sensor_state)||
                !client_info.get_sensor_id(handle, sensor_id)) {
-               ERR("client %s failed to get handle information", get_client_name());
+               _E("client %s failed to get handle information", get_client_name());
                return false;
        }
 
        if (!client_info.get_command_channel(sensor_id, &cmd_channel)) {
-               ERR("client %s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
+               _E("client %s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
                return false;
        }
 
@@ -1127,12 +1127,12 @@ API bool sensord_get_data(int handle, unsigned int data_id, sensor_data_t* senso
        retvm_if ((client_id < 0), false, "Invalid client id : %d, handle: %d, %s, %s", client_id, handle, get_sensor_name(sensor_id), get_client_name());
 
        if (sensor_state != SENSOR_STATE_STARTED) {
-               ERR("Sensor %s is not started for client %s with handle: %d, sensor_state: %d", get_sensor_name(sensor_id), get_client_name(), handle, sensor_state);
+               _E("Sensor %s is not started for client %s with handle: %d, sensor_state: %d", get_sensor_name(sensor_id), get_client_name(), handle, sensor_state);
                return false;
        }
 
        if(!cmd_channel->cmd_get_data(data_id, sensor_data)) {
-               ERR("cmd_get_data(%d, %d, 0x%x) failed for %s", client_id, data_id, sensor_data, get_client_name());
+               _E("cmd_get_data(%d, %d, 0x%x) failed for %s", client_id, data_id, sensor_data, get_client_name());
                return false;
        }
 
index 73f9b45..3fc8ff5 100644 (file)
@@ -113,7 +113,7 @@ const char* get_log_element_name(log_id id, unsigned int type)
        auto iter = g_log_maps[id].find(type);
 
        if (iter == g_log_maps[id].end()) {
-               INFO("Unknown type value: 0x%x", type);
+               _I("Unknown type value: 0x%x", type);
                return p_unknown;
        }
 
@@ -218,11 +218,11 @@ void print_event_occurrence_log(sensor_handle_info &sensor_handle_info, const re
                return;
        }
 
-       INFO("%s receives %s with %s[%d][state: %d, option: %d count: %d]", get_client_name(), log_attr->name,
+       _I("%s receives %s with %s[%d][state: %d, option: %d count: %d]", get_client_name(), log_attr->name,
                        get_sensor_name(sensor_handle_info.m_sensor_id), sensor_handle_info.m_handle, sensor_handle_info.m_sensor_state,
                        sensor_handle_info.m_sensor_option, log_attr->cnt);
 
-       INFO("0x%x(cb_event_type = %s, &user_data, client_data = 0x%x)\n", event_info->m_cb,
+       _I("0x%x(cb_event_type = %s, &user_data, client_data = 0x%x)\n", event_info->m_cb,
                        log_attr->name, event_info->m_user_data);
 }
 
index 06cb549..cdb8fe9 100644 (file)
@@ -39,18 +39,18 @@ command_channel::~command_channel()
 bool command_channel::command_handler(cpacket *packet, void **return_payload)
 {
        if (!m_command_socket.is_valid()) {
-               ERR("Command socket(%d) is not valid for client %s", m_command_socket.get_socket_fd(), get_client_name());
+               _E("Command socket(%d) is not valid for client %s", m_command_socket.get_socket_fd(), get_client_name());
                return false;
        }
 
        if (packet->size() == 0) {
-               ERR("Packet is not valid for client %s", get_client_name());
+               _E("Packet is not valid for client %s", get_client_name());
                return false;
        }
 
        if (m_command_socket.send(packet->packet(), packet->size()) <= 0) {
                m_command_socket.close();
-               ERR("Failed to send command in client %s", get_client_name());
+               _E("Failed to send command in client %s", get_client_name());
                return false;
        }
 
@@ -58,7 +58,7 @@ bool command_channel::command_handler(cpacket *packet, void **return_payload)
 
        if (m_command_socket.recv(&header, sizeof(header)) <= 0) {
                m_command_socket.close();
-               ERR("Failed to receive header for reply packet in client %s", get_client_name());
+               _E("Failed to receive header for reply packet in client %s", get_client_name());
                return false;
        }
 
@@ -67,7 +67,7 @@ bool command_channel::command_handler(cpacket *packet, void **return_payload)
 
        if (m_command_socket.recv(buffer, header.size) <= 0) {
                m_command_socket.close();
-               ERR("Failed to receive reply packet in client %s", get_client_name());
+               _E("Failed to receive reply packet in client %s", get_client_name());
                delete[] buffer;
                return false;
        }
@@ -83,7 +83,7 @@ bool command_channel::create_channel(void)
                return false;
 
        if (!m_command_socket.connect(COMMAND_CHANNEL_PATH)) {
-               ERR("Failed to connect command channel for client %s, command socket fd[%d]", get_client_name(), m_command_socket.get_socket_fd());
+               _E("Failed to connect command channel for client %s, command socket fd[%d]", get_client_name(), m_command_socket.get_socket_fd());
                return false;
        }
 
@@ -112,16 +112,16 @@ bool command_channel::cmd_get_id(int &client_id)
 
        get_proc_name(getpid(), cmd_get_id->name);
 
-       INFO("%s send cmd_get_id()", get_client_name());
+       _I("%s send cmd_get_id()", get_client_name());
 
        if (!command_handler(packet, (void **)&cmd_get_id_done)) {
-               ERR("Client %s failed to send/receive command", get_client_name());
+               _E("Client %s failed to send/receive command", get_client_name());
                delete packet;
                return false;
        }
 
        if (cmd_get_id_done->client_id < 0) {
-               ERR("Client %s failed to get client_id[%d] from server",
+               _E("Client %s failed to get client_id[%d] from server",
                        get_client_name(), cmd_get_id_done->client_id);
                delete[] (char *)cmd_get_id_done;
                delete packet;
@@ -144,10 +144,10 @@ bool command_channel::cmd_get_sensor_list(void)
        packet.set_payload_size(sizeof(cmd_get_sensor_list_t));
        packet.set_cmd(CMD_GET_SENSOR_LIST);
 
-       INFO("%s send cmd_get_sensor_list", get_client_name());
+       _I("%s send cmd_get_sensor_list", get_client_name());
 
        if (!command_handler(&packet, (void **)&cmd_get_sensor_list_done)) {
-               ERR("Client %s failed to send/receive command", get_client_name());
+               _E("Client %s failed to send/receive command", get_client_name());
                return false;
        }
 
@@ -166,7 +166,7 @@ bool command_channel::cmd_get_sensor_list(void)
                info = new(std::nothrow) sensor_info;
 
                if (!info) {
-                       ERR("Failed to allocate memory");
+                       _E("Failed to allocate memory");
                        delete[] (char *)cmd_get_sensor_list_done;
                        return false;
                }
@@ -196,18 +196,18 @@ bool command_channel::cmd_hello(sensor_id_t sensor)
        cmd_hello->client_id = m_client_id;
        cmd_hello->sensor = sensor;
 
-       INFO("%s send cmd_hello(client_id=%d, %s)",
+       _I("%s send cmd_hello(client_id=%d, %s)",
                get_client_name(), m_client_id, get_sensor_name(sensor));
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("Client %s failed to send/receive command for sensor[%s]",
+               _E("Client %s failed to send/receive command for sensor[%s]",
                        get_client_name(), get_sensor_name(sensor));
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("client %s got error[%d] from server with sensor [%s]",
+               _E("client %s got error[%d] from server with sensor [%s]",
                        get_client_name(), cmd_done->value, get_sensor_name(sensor));
 
                delete[] (char *)cmd_done;
@@ -233,18 +233,18 @@ bool command_channel::cmd_byebye(void)
 
        packet->set_cmd(CMD_BYEBYE);
 
-       INFO("%s send cmd_byebye(client_id=%d, %s)",
+       _I("%s send cmd_byebye(client_id=%d, %s)",
                get_client_name(), m_client_id, get_sensor_name(m_sensor_id));
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("Client %s failed to send/receive command for sensor[%s] with client_id [%d]",
+               _E("Client %s failed to send/receive command for sensor[%s] with client_id [%d]",
                        get_client_name(), get_sensor_name(m_sensor_id), m_client_id);
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("Client %s got error[%d] from server for sensor[%s] with client_id [%d]",
+               _E("Client %s got error[%d] from server for sensor[%s] with client_id [%d]",
                        get_client_name(), cmd_done->value, get_sensor_name(m_sensor_id), m_client_id);
 
                delete[] (char *)cmd_done;
@@ -275,18 +275,18 @@ bool command_channel::cmd_start(void)
 
        packet->set_cmd(CMD_START);
 
-       INFO("%s send cmd_start(client_id=%d, %s)",
+       _I("%s send cmd_start(client_id=%d, %s)",
                get_client_name(), m_client_id, get_sensor_name(m_sensor_id));
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("Client %s failed to send/receive command for sensor[%s] with client_id [%d]",
+               _E("Client %s failed to send/receive command for sensor[%s] with client_id [%d]",
                        get_client_name(), get_sensor_name(m_sensor_id), m_client_id);
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("Client %s got error[%d] from server for sensor[%s] with client_id [%d]",
+               _E("Client %s got error[%d] from server for sensor[%s] with client_id [%d]",
                        get_client_name(), cmd_done->value, get_sensor_name(m_sensor_id), m_client_id);
 
                delete[] (char *)cmd_done;
@@ -310,18 +310,18 @@ bool command_channel::cmd_stop(void)
 
        packet->set_cmd(CMD_STOP);
 
-       INFO("%s send cmd_stop(client_id=%d, %s)",
+       _I("%s send cmd_stop(client_id=%d, %s)",
                get_client_name(), m_client_id, get_sensor_name(m_sensor_id));
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("Client %s failed to send/receive command for sensor[%s] with client_id [%d]",
+               _E("Client %s failed to send/receive command for sensor[%s] with client_id [%d]",
                        get_client_name(), get_sensor_name(m_sensor_id), m_client_id);
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("Client %s got error[%d] from server for sensor[%s] with client_id [%d]",
+               _E("Client %s got error[%d] from server for sensor[%s] with client_id [%d]",
                        get_client_name(), cmd_done->value, get_sensor_name(m_sensor_id), m_client_id);
 
                delete[] (char *)cmd_done;
@@ -349,18 +349,18 @@ bool command_channel::cmd_set_option(int option)
        cmd_set_option = (cmd_set_option_t*)packet->data();
        cmd_set_option->option = option;
 
-       INFO("%s send cmd_set_option(client_id=%d, %s, option=%d)",
+       _I("%s send cmd_set_option(client_id=%d, %s, option=%d)",
                get_client_name(), m_client_id, get_sensor_name(m_sensor_id), option);
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("Client %s failed to send/receive command for sensor[%s] with client_id [%d], option[%d]",
+               _E("Client %s failed to send/receive command for sensor[%s] with client_id [%d], option[%d]",
                        get_client_name(), get_sensor_name(m_sensor_id), m_client_id, option);
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("Client %s got error[%d] from server for sensor[%s] with client_id [%d], option[%d]",
+               _E("Client %s got error[%d] from server for sensor[%s] with client_id [%d], option[%d]",
                        get_client_name(), cmd_done->value, get_sensor_name(m_sensor_id), m_client_id, option);
 
                delete[] (char *)cmd_done;
@@ -388,18 +388,18 @@ bool command_channel::cmd_set_wakeup(int wakeup)
        cmd_set_wakeup = (cmd_set_wakeup_t*)packet->data();
        cmd_set_wakeup->wakeup = wakeup;
 
-       INFO("%s send cmd_set_wakeup(client_id=%d, %s, wakeup=%d)",
+       _I("%s send cmd_set_wakeup(client_id=%d, %s, wakeup=%d)",
                get_client_name(), m_client_id, get_sensor_name(m_sensor_id), wakeup);
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("Client %s failed to send/receive command for sensor[%s] with client_id [%d], wakeup[%d]",
+               _E("Client %s failed to send/receive command for sensor[%s] with client_id [%d], wakeup[%d]",
                        get_client_name(), get_sensor_name(m_sensor_id), m_client_id, wakeup);
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("Client %s got error[%d] from server for sensor[%s] with client_id [%d], wakeup[%d]",
+               _E("Client %s got error[%d] from server for sensor[%s] with client_id [%d], wakeup[%d]",
                        get_client_name(), cmd_done->value, get_sensor_name(m_sensor_id), m_client_id, wakeup);
 
                delete[] (char *)cmd_done;
@@ -427,18 +427,18 @@ bool command_channel::cmd_register_event(unsigned int event_type)
        cmd_reg = (cmd_reg_t*)packet->data();
        cmd_reg->event_type = event_type;
 
-       INFO("%s send cmd_register_event(client_id=%d, %s)",
+       _I("%s send cmd_register_event(client_id=%d, %s)",
                get_client_name(), m_client_id, get_event_name(event_type));
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("Client %s failed to send/receive command with client_id [%d], event_type[%s]",
+               _E("Client %s failed to send/receive command with client_id [%d], event_type[%s]",
                        get_client_name(), m_client_id, get_event_name(event_type));
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("Client %s got error[%d] from server with client_id [%d], event_type[%s]",
+               _E("Client %s got error[%d] from server with client_id [%d], event_type[%s]",
                        get_client_name(), cmd_done->value, m_client_id, get_event_name(event_type));
 
                delete[] (char *)cmd_done;
@@ -481,18 +481,18 @@ bool command_channel::cmd_unregister_event(unsigned int event_type)
        cmd_unreg = (cmd_unreg_t*)packet->data();
        cmd_unreg->event_type = event_type;
 
-       INFO("%s send cmd_unregister_event(client_id=%d, %s)",
+       _I("%s send cmd_unregister_event(client_id=%d, %s)",
                get_client_name(), m_client_id, get_event_name(event_type));
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("Client %s failed to send/receive command with client_id [%d], event_type[%s]",
+               _E("Client %s failed to send/receive command with client_id [%d], event_type[%s]",
                        get_client_name(), m_client_id, get_event_name(event_type));
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("Client %s got error[%d] from server with client_id [%d], event_type[%s]",
+               _E("Client %s got error[%d] from server with client_id [%d], event_type[%s]",
                        get_client_name(), cmd_done->value, m_client_id, get_event_name(event_type));
 
                delete[] (char *)cmd_done;
@@ -536,18 +536,18 @@ bool command_channel::cmd_set_batch(unsigned int interval, unsigned int latency)
        cmd_set_batch->interval = interval;
        cmd_set_batch->latency = latency;
 
-       INFO("%s send cmd_set_batch(client_id=%d, %s, interval=%d, latency = %d)",
+       _I("%s send cmd_set_batch(client_id=%d, %s, interval=%d, latency = %d)",
                get_client_name(), m_client_id, get_sensor_name(m_sensor_id), interval, latency);
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("%s failed to send/receive command for sensor[%s] with client_id [%d], interval[%d], latency[%d]",
+               _E("%s failed to send/receive command for sensor[%s] with client_id [%d], interval[%d], latency[%d]",
                        get_client_name(), get_sensor_name(m_sensor_id), m_client_id, interval, latency);
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("%s got error[%d] from server for sensor[%s] with client_id [%d], interval[%d], latency[%d]",
+               _E("%s got error[%d] from server for sensor[%s] with client_id [%d], interval[%d], latency[%d]",
                        get_client_name(), cmd_done->value, get_sensor_name(m_sensor_id), m_client_id, interval, latency);
 
                delete[] (char *)cmd_done;
@@ -571,18 +571,18 @@ bool command_channel::cmd_unset_batch(void)
 
        packet->set_cmd(CMD_UNSET_BATCH);
 
-       INFO("%s send cmd_unset_batch(client_id=%d, %s)",
+       _I("%s send cmd_unset_batch(client_id=%d, %s)",
                get_client_name(), m_client_id, get_sensor_name(m_sensor_id));
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("Client %s failed to send/receive command for sensor[%s] with client_id [%d]",
+               _E("Client %s failed to send/receive command for sensor[%s] with client_id [%d]",
                        get_client_name(), get_sensor_name(m_sensor_id), m_client_id);
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("Client %s got error[%d] from server for sensor[%s] with client_id [%d]",
+               _E("Client %s got error[%d] from server for sensor[%s] with client_id [%d]",
                        get_client_name(), cmd_done->value, get_sensor_name(m_sensor_id), m_client_id);
 
                delete[] (char *)cmd_done;
@@ -611,14 +611,14 @@ bool command_channel::cmd_get_data(unsigned int type, sensor_data_t* sensor_data
        cmd_get_data->type = type;
 
        if (!command_handler(packet, (void **)&cmd_get_data_done)) {
-               ERR("Client %s failed to send/receive command with client_id [%d], data_id[%s]",
+               _E("Client %s failed to send/receive command with client_id [%d], data_id[%s]",
                        get_client_name(), m_client_id, get_data_name(type));
                delete packet;
                return false;
        }
 
        if (cmd_get_data_done->state < 0 ) {
-               ERR("Client %s got error[%d] from server with client_id [%d], data_id[%s]",
+               _E("Client %s got error[%d] from server with client_id [%d], data_id[%s]",
                        get_client_name(), cmd_get_data_done->state, m_client_id, get_data_name(type));
                sensor_data->accuracy = SENSOR_ACCURACY_UNDEFINED;
                sensor_data->timestamp = 0;
@@ -659,18 +659,18 @@ bool command_channel::cmd_set_attribute_int(int attribute, int value)
        cmd_set_attribute_int->attribute = attribute;
        cmd_set_attribute_int->value = value;
 
-       INFO("%s send cmd_set_attribute_int(client_id=%d, %s, 0x%x, %d)",
+       _I("%s send cmd_set_attribute_int(client_id=%d, %s, 0x%x, %d)",
                get_client_name(), m_client_id, get_sensor_name(m_sensor_id), attribute, value);
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("Client %s failed to send/receive command for sensor[%s] with client_id [%d], property[0x%x], value[%d]",
+               _E("Client %s failed to send/receive command for sensor[%s] with client_id [%d], property[0x%x], value[%d]",
                        get_client_name(), get_sensor_name(m_sensor_id), m_client_id, attribute, value);
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("Client %s got error[%d] from server for sensor[%s] with property[0x%x], value[%d]",
+               _E("Client %s got error[%d] from server for sensor[%s] with property[0x%x], value[%d]",
                        get_client_name(), cmd_done->value, get_sensor_name(m_sensor_id), attribute, value);
 
                delete[] (char *)cmd_done;
@@ -700,18 +700,18 @@ bool command_channel::cmd_set_attribute_str(int attribute, const char* value, in
        cmd_set_attribute_str->value_len = value_len;
        memcpy(cmd_set_attribute_str->value, value, value_len);
 
-       INFO("%s send cmd_set_attribute_str(client_id=%d, value_len = %d, buffer = 0x%x)",
+       _I("%s send cmd_set_attribute_str(client_id=%d, value_len = %d, buffer = 0x%x)",
                get_client_name(), m_client_id, value_len, value);
 
        if (!command_handler(packet, (void **)&cmd_done)) {
-               ERR("%s failed to send/receive command with client_id [%d]",
+               _E("%s failed to send/receive command with client_id [%d]",
                        get_client_name(), m_client_id);
                delete packet;
                return false;
        }
 
        if (cmd_done->value < 0) {
-               ERR("%s got error[%d] from server with client_id [%d]",
+               _E("%s got error[%d] from server with client_id [%d]",
                        get_client_name(), cmd_done->value, m_client_id);
 
                delete[] (char *)cmd_done;
index 1e2c12c..30dfab2 100644 (file)
@@ -58,7 +58,7 @@ int sensor_client_info::create_handle(sensor_id_t sensor)
                handle++;
 
        if (handle == MAX_HANDLE) {
-               ERR("Handles of client %s are full", get_client_name());
+               _E("Handles of client %s are full", get_client_name());
                return MAX_HANDLE_REACHED;
        }
 
@@ -82,7 +82,7 @@ bool sensor_client_info::delete_handle(int handle)
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -106,7 +106,7 @@ bool sensor_client_info::register_event(int handle, unsigned int event_type,
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -123,7 +123,7 @@ bool sensor_client_info::unregister_event(int handle, unsigned int event_type)
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -140,7 +140,7 @@ bool sensor_client_info::register_accuracy_cb(int handle, sensor_accuracy_change
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -158,7 +158,7 @@ bool sensor_client_info::unregister_accuracy_cb(int handle)
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -176,7 +176,7 @@ bool sensor_client_info::set_sensor_params(int handle, int sensor_state, int sen
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -193,7 +193,7 @@ bool sensor_client_info::get_sensor_params(int handle, int &sensor_state, int &s
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -210,7 +210,7 @@ bool sensor_client_info::set_sensor_state(int handle, int sensor_state)
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -226,7 +226,7 @@ bool sensor_client_info::set_sensor_option(int handle, int sensor_option)
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -242,7 +242,7 @@ bool sensor_client_info::set_event_batch(int handle, unsigned int event_type, un
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -259,7 +259,7 @@ bool sensor_client_info::set_event_maincontext(int handle, unsigned int event_ty
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -276,7 +276,7 @@ bool sensor_client_info::set_accuracy(int handle, int accuracy)
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -292,7 +292,7 @@ bool sensor_client_info::set_bad_accuracy(int handle, int bad_accuracy)
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -308,7 +308,7 @@ bool sensor_client_info::get_event_info(int handle, unsigned int event_type, uns
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -363,7 +363,7 @@ bool sensor_client_info::add_command_channel(sensor_id_t sensor, command_channel
        auto it_channel = m_command_channels.find(sensor);
 
        if (it_channel != m_command_channels.end()) {
-               ERR("%s alreay has command_channel for %s", get_client_name(), get_sensor_name(sensor));
+               _E("%s alreay has command_channel for %s", get_client_name(), get_sensor_name(sensor));
                return false;
        }
 
@@ -377,7 +377,7 @@ bool sensor_client_info::get_command_channel(sensor_id_t sensor, command_channel
        auto it_channel = m_command_channels.find(sensor);
 
        if (it_channel == m_command_channels.end()) {
-               ERR("%s doesn't have command_channel for %s", get_client_name(), get_sensor_name(sensor));
+               _E("%s doesn't have command_channel for %s", get_client_name(), get_sensor_name(sensor));
                return false;
        }
 
@@ -406,7 +406,7 @@ bool sensor_client_info::close_command_channel(sensor_id_t sensor_id)
        auto it_channel = m_command_channels.find(sensor_id);
 
        if (it_channel == m_command_channels.end()) {
-               ERR("%s doesn't have command_channel for %s", get_client_name(), get_sensor_name(sensor_id));
+               _E("%s doesn't have command_channel for %s", get_client_name(), get_sensor_name(sensor_id));
                return false;
        }
 
@@ -459,7 +459,7 @@ bool sensor_client_info::get_active_batch(sensor_id_t sensor, unsigned int &inte
        }
 
        if (!active_sensor_found) {
-               DBG("Active sensor[0x%llx] is not found for client %s", sensor, get_client_name());
+               _D("Active sensor[0x%llx] is not found for client %s", sensor, get_client_name());
                return false;
        }
 
@@ -491,7 +491,7 @@ unsigned int sensor_client_info::get_active_option(sensor_id_t sensor)
        }
 
        if (!active_sensor_found)
-               DBG("Active sensor[0x%llx] is not found for client %s", sensor, get_client_name());
+               _D("Active sensor[0x%llx] is not found for client %s", sensor, get_client_name());
 
        return active_option;
 }
@@ -503,7 +503,7 @@ bool sensor_client_info::get_sensor_id(int handle, sensor_id_t &sensor)
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -519,7 +519,7 @@ bool sensor_client_info::get_sensor_state(int handle, int &sensor_state)
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -535,7 +535,7 @@ bool sensor_client_info::get_sensor_wakeup(int handle, int &sensor_wakeup)
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
@@ -551,7 +551,7 @@ bool sensor_client_info::set_sensor_wakeup(int handle, int sensor_wakeup)
        auto it_handle = m_sensor_handle_infos.find(handle);
 
        if (it_handle == m_sensor_handle_infos.end()) {
-               ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+               _E("Handle[%d] is not found for client %s", handle, get_client_name());
                return false;
        }
 
index 6d62eb5..4550da6 100644 (file)
@@ -87,13 +87,13 @@ void sensor_event_listener::operate_sensor(sensor_id_t sensor, int power_save_st
                                !(it_handle->second.m_sensor_option & power_save_state)) {
 
                                m_client_info.set_sensor_state(it_handle->first, SENSOR_STATE_PAUSED);
-                               INFO("%s's %s[%d] is paused", get_client_name(), get_sensor_name(sensor), it_handle->first);
+                               _I("%s's %s[%d] is paused", get_client_name(), get_sensor_name(sensor), it_handle->first);
 
                        } else if ((it_handle->second.m_sensor_state == SENSOR_STATE_PAUSED) &&
                                (!power_save_state || (it_handle->second.m_sensor_option & power_save_state))) {
 
                                m_client_info.set_sensor_state(it_handle->first, SENSOR_STATE_STARTED);
-                               INFO("%s's %s[%d] is resumed", get_client_name(), get_sensor_name(sensor), it_handle->first);
+                               _I("%s's %s[%d] is resumed", get_client_name(), get_sensor_name(sensor), it_handle->first);
                        }
                }
 
@@ -220,7 +220,7 @@ void sensor_event_listener::handle_events(void* event)
                                callback_info = get_callback_info(sensor_id, event_info, sensor_data, event);
 
                        if (!callback_info) {
-                               ERR("Failed to get callback_info");
+                               _E("Failed to get callback_info");
                                continue;
                        }
 
@@ -307,7 +307,7 @@ gboolean sensor_event_listener::callback_dispatcher(gpointer data)
                else if (cb_info->cb_type == SENSOR_LEGACY_CB)
                        ((sensor_legacy_cb_t) cb_info->cb)(cb_info->event_type, (sensor_event_data_t *) cb_info->sensor_data, cb_info->user_data);
        } else {
-               WARN("Discard invalid callback cb(0x%x)(%s, 0x%x, 0x%x) with id: %llu",
+               _W("Discard invalid callback cb(0x%x)(%s, 0x%x, 0x%x) with id: %llu",
                cb_info->cb, get_event_name(cb_info->event_type), cb_info->sensor_data,
                cb_info->user_data, cb_info->event_id);
        }
@@ -340,13 +340,13 @@ ssize_t sensor_event_listener::sensor_event_poll(void* buffer, int buffer_len, s
                len = m_event_socket.recv(buffer, buffer_len);
 
                if (!len) {
-                       INFO("%s failed to read after poll!", get_client_name());
+                       _I("%s failed to read after poll!", get_client_name());
                        return -1;
                }
        }
 
        if (len < 0) {
-               INFO("%s failed to recv event from event socket", get_client_name());
+               _I("%s failed to recv event from event socket", get_client_name());
                return -1;
        }
 
@@ -366,20 +366,20 @@ void sensor_event_listener::listen_events(void)
                        void *buffer = malloc(EVENT_BUFFER_SIZE);
 
                        if (!buffer) {
-                               ERR("Failed to allocate memory");
+                               _E("Failed to allocate memory");
                                break;
                        }
 
                        len = sensor_event_poll(buffer, EVENT_BUFFER_SIZE, event);
                        if (len <= 0) {
-                               INFO("sensor_event_poll failed");
+                               _I("sensor_event_poll failed");
                                free(buffer);
                                break;
                        }
 
                        void *buffer_shrinked = realloc(buffer, len);
                        if (!buffer_shrinked) {
-                               ERR("Failed to allocate memory");
+                               _E("Failed to allocate memory");
                                free(buffer);
                                break;
                        }
@@ -403,7 +403,7 @@ void sensor_event_listener::listen_events(void)
                m_thread_cond.notify_one();
        }
 
-       INFO("Event listener thread is terminated.");
+       _I("Event listener thread is terminated.");
 
        if (m_client_info.has_client_id() && (event.events & EPOLLHUP)) {
                if (m_hup_observer)
@@ -421,35 +421,35 @@ bool sensor_event_listener::create_event_channel(void)
                return false;
 
        if (!m_event_socket.connect(EVENT_CHANNEL_PATH)) {
-               ERR("Failed to connect event channel for client %s, event socket fd[%d]", get_client_name(), m_event_socket.get_socket_fd());
+               _E("Failed to connect event channel for client %s, event socket fd[%d]", get_client_name(), m_event_socket.get_socket_fd());
                return false;
        }
 
        if (!m_event_socket.set_connection_mode()) {
-               ERR("Failed to set connection mode for client %s", get_client_name());
+               _E("Failed to set connection mode for client %s", get_client_name());
                return false;
        }
 
        client_id = m_client_info.get_client_id();
 
        if (m_event_socket.send(&client_id, sizeof(client_id)) <= 0) {
-               ERR("Failed to send client id for client %s on event socket[%d]", get_client_name(), m_event_socket.get_socket_fd());
+               _E("Failed to send client id for client %s on event socket[%d]", get_client_name(), m_event_socket.get_socket_fd());
                return false;
        }
 
        if (m_event_socket.recv(&event_channel_ready, sizeof(event_channel_ready)) <= 0) {
-               ERR("%s failed to recv event_channel_ready packet on event socket[%d] with client id [%d]",
+               _E("%s failed to recv event_channel_ready packet on event socket[%d] with client id [%d]",
                        get_client_name(), m_event_socket.get_socket_fd(), client_id);
                return false;
        }
 
        if ((event_channel_ready.magic != EVENT_CHANNEL_MAGIC) || (event_channel_ready.client_id != client_id)) {
-               ERR("Event_channel_ready packet is wrong, magic = 0x%x, client id = %d",
+               _E("Event_channel_ready packet is wrong, magic = 0x%x, client id = %d",
                        event_channel_ready.magic, event_channel_ready.client_id);
                return false;
        }
 
-       INFO("Event channel is established for client %s on socket[%d] with client id : %d",
+       _I("Event channel is established for client %s on socket[%d] with client id : %d",
                get_client_name(), m_event_socket.get_socket_fd(), client_id);
 
        return true;
@@ -471,12 +471,12 @@ void sensor_event_listener::stop_event_listener(void)
        if (m_thread_state != THREAD_STATE_TERMINATE) {
                m_thread_state = THREAD_STATE_STOP;
 
-               DBG("%s is waiting listener thread[state: %d] to be terminated", get_client_name(), m_thread_state);
+               _D("%s is waiting listener thread[state: %d] to be terminated", get_client_name(), m_thread_state);
                if (m_thread_cond.wait_for(u, std::chrono::seconds(THREAD_TERMINATING_TIMEOUT))
                        == std::cv_status::timeout)
-                       ERR("Fail to stop listener thread after waiting %d seconds", THREAD_TERMINATING_TIMEOUT);
+                       _E("Fail to stop listener thread after waiting %d seconds", THREAD_TERMINATING_TIMEOUT);
                else
-                       DBG("Listener thread for %s is terminated", get_client_name());
+                       _D("Listener thread for %s is terminated", get_client_name());
        }
 }
 
@@ -504,7 +504,7 @@ void sensor_event_listener::set_hup_observer(hup_observer_t observer)
 bool sensor_event_listener::start_event_listener(void)
 {
        if (!create_event_channel()) {
-               ERR("Event channel is not established for %s", get_client_name());
+               _E("Event channel is not established for %s", get_client_name());
                return false;
        }
 
index 1439d43..1be96c0 100644 (file)
@@ -49,7 +49,7 @@ reg_event_info* sensor_handle_info::get_reg_event_info(unsigned int event_type)
        auto it_event = m_reg_event_infos.find(event_type);
 
        if (it_event == m_reg_event_infos.end()) {
-               DBG("Event %s[0x%x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name());
+               _D("Event %s[0x%x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name());
                return NULL;
        }
 
@@ -73,7 +73,7 @@ bool sensor_handle_info::add_reg_event_info(unsigned int event_type, unsigned in
        auto it_event = m_reg_event_infos.find(event_type);
 
        if (it_event != m_reg_event_infos.end()) {
-               ERR("Event %s[0x%x] is already registered for client %s", get_event_name(event_type), event_type, get_client_name());
+               _E("Event %s[0x%x] is already registered for client %s", get_event_name(event_type), event_type, get_client_name());
                return false;
        }
 
@@ -96,7 +96,7 @@ bool sensor_handle_info::delete_reg_event_info(unsigned int event_type)
        auto it_event = m_reg_event_infos.find(event_type);
 
        if (it_event == m_reg_event_infos.end()) {
-               ERR("Event %s[0x%x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name());
+               _E("Event %s[0x%x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name());
                return false;
        }
 
@@ -121,7 +121,7 @@ bool sensor_handle_info::change_reg_event_batch(unsigned int event_type, unsigne
        auto it_event = m_reg_event_infos.find(event_type);
 
        if (it_event == m_reg_event_infos.end()) {
-               ERR("Event %s[0x%x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name());
+               _E("Event %s[0x%x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name());
                return false;
        }
 
@@ -137,7 +137,7 @@ bool sensor_handle_info::change_reg_event_maincontext(unsigned int event_type, G
        auto it_event = m_reg_event_infos.find(event_type);
 
        if (it_event == m_reg_event_infos.end()) {
-               ERR("Event %s[0x%x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name());
+               _E("Event %s[0x%x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name());
                return false;
        }
 
@@ -149,7 +149,7 @@ bool sensor_handle_info::change_reg_event_maincontext(unsigned int event_type, G
 void sensor_handle_info::get_batch(unsigned int &interval, unsigned int &latency)
 {
        if (m_reg_event_infos.empty()) {
-               DBG("No events are registered for client %s", get_client_name());
+               _D("No events are registered for client %s", get_client_name());
                interval = POLL_MAX_HZ_MS;
                latency = 0;
                return;
index 037e9a1..c7f1c25 100644 (file)
@@ -46,7 +46,7 @@ bool client_info_manager::get_registered_events(int client_id, sensor_id_t senso
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -64,7 +64,7 @@ bool client_info_manager::register_event(int client_id, sensor_id_t sensor_id, u
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -81,7 +81,7 @@ bool client_info_manager::unregister_event(int client_id, sensor_id_t sensor_id,
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -98,7 +98,7 @@ bool client_info_manager::set_batch(int client_id, sensor_id_t sensor_id, unsign
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -112,7 +112,7 @@ bool client_info_manager::get_batch(int client_id, sensor_id_t sensor_id, unsign
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -126,7 +126,7 @@ bool client_info_manager::set_option(int client_id, sensor_id_t sensor_id, int o
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -143,7 +143,7 @@ bool client_info_manager::set_wakeup(int client_id, sensor_id_t sensor_id, int w
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -160,7 +160,7 @@ bool client_info_manager::set_start(int client_id, sensor_id_t sensor_id, bool s
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -178,7 +178,7 @@ bool client_info_manager::is_started(int client_id, sensor_id_t sensor_id)
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -197,7 +197,7 @@ int client_info_manager::create_client_record(void)
                client_id++;
 
        if (client_id == MAX_HANDLE) {
-               ERR("Sensor records of clients are full");
+               _E("Sensor records of clients are full");
                return MAX_HANDLE_REACHED;
        }
 
@@ -216,13 +216,13 @@ bool client_info_manager::remove_client_record(int client_id)
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
        m_clients.erase(it_record);
 
-       INFO("Client record for client[%d] is removed from client info manager", client_id);
+       _I("Client record for client[%d] is removed from client info manager", client_id);
 
        return true;
 }
@@ -245,7 +245,7 @@ void client_info_manager::set_client_info(int client_id, pid_t pid, const string
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return;
        }
 
@@ -261,7 +261,7 @@ const char* client_info_manager::get_client_info(int client_id)
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               DBG("Client[%d] is not found", client_id);
+               _D("Client[%d] is not found", client_id);
                return NULL;
        }
 
@@ -275,7 +275,7 @@ bool client_info_manager::set_permission(int client_id, int permission)
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               DBG("Client[%d] is not found", client_id);
+               _D("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -290,7 +290,7 @@ bool client_info_manager::get_permission(int client_id, int &permission)
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               DBG("Client[%d] is not found", client_id);
+               _D("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -305,7 +305,7 @@ bool client_info_manager::create_sensor_record(int client_id, sensor_id_t sensor
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client record[%d] is not registered", client_id);
+               _E("Client record[%d] is not registered", client_id);
                return false;
        }
 
@@ -321,7 +321,7 @@ bool client_info_manager::remove_sensor_record(int client_id, sensor_id_t sensor
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -342,7 +342,7 @@ bool client_info_manager::has_sensor_record(int client_id, sensor_id_t sensor_id
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               DBG("Client[%d] is not found", client_id);
+               _D("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -359,7 +359,7 @@ bool client_info_manager::has_sensor_record(int client_id)
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               DBG("Client[%d] is not found", client_id);
+               _D("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -392,7 +392,7 @@ bool client_info_manager::get_event_socket(int client_id, csocket &socket)
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
@@ -409,7 +409,7 @@ bool client_info_manager::set_event_socket(int client_id, const csocket &socket)
        auto it_record = m_clients.find(client_id);
 
        if (it_record == m_clients.end()) {
-               ERR("Client[%d] is not found", client_id);
+               _E("Client[%d] is not found", client_id);
                return false;
        }
 
index da52cf4..cdca1e1 100644 (file)
@@ -49,7 +49,7 @@ bool client_sensor_record::register_event(sensor_id_t sensor_id, unsigned int ev
        }
 
        if (!it_usage->second.register_event(event_type)) {
-               ERR("Event[0x%x] is already registered", event_type);
+               _E("Event[0x%x] is already registered", event_type);
                return false;
        }
 
@@ -61,12 +61,12 @@ bool client_sensor_record::unregister_event(sensor_id_t sensor_id, unsigned int
        auto it_usage = m_sensor_usages.find(sensor_id);
 
        if (it_usage == m_sensor_usages.end()) {
-               ERR("Sensor[0x%x] is not registered", sensor_id);
+               _E("Sensor[0x%x] is not registered", sensor_id);
                return false;
        }
 
        if (!it_usage->second.unregister_event(event_type)) {
-               ERR("Event[0x%x] is already registered", event_type);
+               _E("Event[0x%x] is already registered", event_type);
                return false;
        }
 
@@ -150,7 +150,7 @@ bool client_sensor_record::get_batch(sensor_id_t sensor_id, unsigned int &interv
        auto it_usage = m_sensor_usages.find(sensor_id);
 
        if (it_usage == m_sensor_usages.end()) {
-               ERR("Sensor[0x%x] is not found", sensor_id);
+               _E("Sensor[0x%x] is not found", sensor_id);
                return false;
        }
 
@@ -178,7 +178,7 @@ bool client_sensor_record::add_sensor_usage(sensor_id_t sensor_id)
        auto it_usage = m_sensor_usages.find(sensor_id);
 
        if (it_usage != m_sensor_usages.end()) {
-               ERR("Sensor[0x%x] is already registered", sensor_id);
+               _E("Sensor[0x%x] is already registered", sensor_id);
                return false;
        }
 
@@ -192,7 +192,7 @@ bool client_sensor_record::remove_sensor_usage(sensor_id_t sensor_id)
        auto it_usage = m_sensor_usages.find(sensor_id);
 
        if (it_usage == m_sensor_usages.end()) {
-               ERR("Sensor[0x%x] is not found", sensor_id);
+               _E("Sensor[0x%x] is not found", sensor_id);
                return false;
        }
        m_sensor_usages.erase(it_usage);
@@ -213,7 +213,7 @@ bool client_sensor_record::has_sensor_usage(sensor_id_t sensor_id)
        auto it_usage = m_sensor_usages.find(sensor_id);
 
        if (it_usage == m_sensor_usages.end()) {
-               DBG("Sensor[0x%x] is not found", sensor_id);
+               _D("Sensor[0x%x] is not found", sensor_id);
                return false;
        }
 
@@ -226,7 +226,7 @@ bool client_sensor_record::get_registered_events(sensor_id_t sensor_id, event_ty
        auto it_usage = m_sensor_usages.find(sensor_id);
 
        if (it_usage == m_sensor_usages.end()) {
-               DBG("Sensor[0x%x] is not found", sensor_id);
+               _D("Sensor[0x%x] is not found", sensor_id);
                return false;
        }
 
index b6491ab..1df1fda 100644 (file)
@@ -183,7 +183,7 @@ bool command_worker::working(void *ctx)
        if (inst->m_socket.recv(&header, sizeof(header)) <= 0) {
                string info;
                inst->get_info(info);
-               DBG("%s failed to receive header", info.c_str());
+               _D("%s failed to receive header", info.c_str());
                return false;
        }
 
@@ -195,7 +195,7 @@ bool command_worker::working(void *ctx)
                if (inst->m_socket.recv(payload, header.size) <= 0) {
                        string info;
                        inst->get_info(info);
-                       DBG("%s failed to receive data of packet", info.c_str());
+                       _D("%s failed to receive data of packet", info.c_str());
                        delete[] payload;
                        return false;
                }
@@ -218,19 +218,19 @@ bool command_worker::stopped(void *ctx)
        command_worker *inst = (command_worker *)ctx;
 
        inst->get_info(info);
-       INFO("%s is stopped", info.c_str());
+       _I("%s is stopped", info.c_str());
 
        if ((inst->m_module) && (inst->m_client_id != CLIENT_ID_INVALID)) {
 
                if (get_client_info_manager().is_started(inst->m_client_id, inst->m_sensor_id)) {
-                       WARN("Does not receive cmd_stop before connection broken for [%s]!!", inst->m_module->get_name());
+                       _W("Does not receive cmd_stop before connection broken for [%s]!!", inst->m_module->get_name());
                        inst->m_module->delete_interval(inst->m_client_id, false);
                        inst->m_module->stop();
                }
 
                if (inst->m_sensor_id) {
                        if (get_client_info_manager().has_sensor_record(inst->m_client_id, inst->m_sensor_id)) {
-                               INFO("Removing sensor[0x%llx] record for client_id[%d]", inst->m_sensor_id, inst->m_client_id);
+                               _I("Removing sensor[0x%llx] record for client_id[%d]", inst->m_sensor_id, inst->m_client_id);
                                get_client_info_manager().remove_sensor_record(inst->m_client_id, inst->m_sensor_id);
                        }
                }
@@ -245,7 +245,7 @@ bool command_worker::dispatch_command(int cmd, void* payload)
        int ret = false;
 
        if (!(cmd > 0 && cmd < CMD_CNT)) {
-               ERR("Unknown command: %d", cmd);
+               _E("Unknown command: %d", cmd);
        } else {
                cmd_handler_t cmd_handler;
                cmd_handler = command_worker::m_cmd_handlers[cmd];
@@ -270,7 +270,7 @@ bool command_worker::send_cmd_done(long value)
        cmd_done->value = value;
 
        if (m_socket.send(ret_packet->packet(), ret_packet->size()) <= 0) {
-               ERR("Failed to send a cmd_done to client_id [%d] with value [%ld]", m_client_id, value);
+               _E("Failed to send a cmd_done to client_id [%d] with value [%ld]", m_client_id, value);
                delete ret_packet;
                return false;
        }
@@ -295,7 +295,7 @@ bool command_worker::send_cmd_get_id_done(int client_id)
        cmd_get_id_done->client_id = client_id;
 
        if (m_socket.send(ret_packet->packet(), ret_packet->size()) <= 0) {
-               ERR("Failed to send a cmd_get_id_done with client_id [%d]", client_id);
+               _E("Failed to send a cmd_get_id_done with client_id [%d]", client_id);
                delete ret_packet;
                return false;
        }
@@ -320,7 +320,7 @@ bool command_worker::send_cmd_get_data_done(int state, sensor_data_t *data)
        memcpy(&cmd_get_data_done->base_data , data, sizeof(sensor_data_t));
 
        if (m_socket.send(ret_packet->packet(), ret_packet->size()) <= 0) {
-               ERR("Failed to send a cmd_get_data_done");
+               _E("Failed to send a cmd_get_data_done");
                delete ret_packet;
                return false;
        }
@@ -336,12 +336,12 @@ bool command_worker::send_cmd_get_sensor_list_done(void)
 
        int permission = get_permission();
 
-       INFO("permission = 0x%x", permission);
+       _I("permission = 0x%x", permission);
 
        get_sensor_list(permission, sensor_list);
 
        if (m_socket.send(sensor_list.packet(), sensor_list.size()) <= 0) {
-               ERR("Failed to send a cmd_get_sensor_list_done");
+               _E("Failed to send a cmd_get_sensor_list_done");
                return false;
        }
 
@@ -355,11 +355,11 @@ bool command_worker::cmd_get_id(void *payload)
        struct ucred cr;
        socklen_t opt_len = sizeof(cr);
 
-       DBG("CMD_GET_ID Handler invoked\n");
+       _D("CMD_GET_ID Handler invoked\n");
        cmd = (cmd_get_id_t*)payload;
 
        if (getsockopt(m_socket.get_socket_fd(), SOL_SOCKET, SO_PEERCRED, &cr, &opt_len)) {
-               ERR("Failed to get socket option with SO_PEERCRED");
+               _E("Failed to get socket option with SO_PEERCRED");
                return false;
        }
 
@@ -370,10 +370,10 @@ bool command_worker::cmd_get_id(void *payload)
        m_permission = get_permission();
        get_client_info_manager().set_permission(client_id, m_permission);
 
-       INFO("New client id [%d] created", client_id);
+       _I("New client id [%d] created", client_id);
 
        if (!send_cmd_get_id_done(client_id))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
@@ -381,10 +381,10 @@ bool command_worker::cmd_get_id(void *payload)
 
 bool command_worker::cmd_get_sensor_list(void *payload)
 {
-       DBG("CMD_GET_SENSOR_LIST Handler invoked\n");
+       _D("CMD_GET_SENSOR_LIST Handler invoked\n");
 
        if (!send_cmd_get_sensor_list_done())
-               ERR("Failed to send cmd_get_sensor_list_done to a client");
+               _E("Failed to send cmd_get_sensor_list_done to a client");
 
        return true;
 }
@@ -394,7 +394,7 @@ bool command_worker::cmd_hello(void *payload)
        cmd_hello_t *cmd;
        long ret_value = OP_ERROR;
 
-       DBG("CMD_HELLO Handler invoked\n");
+       _D("CMD_HELLO Handler invoked\n");
        cmd = (cmd_hello_t*)payload;
 
        m_sensor_id = cmd->sensor;
@@ -406,7 +406,7 @@ bool command_worker::cmd_hello(void *payload)
        m_module = (sensor_base *)sensor_loader::get_instance().get_sensor(cmd->sensor);
 
        if (!m_module) {
-               ERR("Sensor type[%d] is not supported", cmd->sensor);
+               _E("Sensor type[%d] is not supported", cmd->sensor);
                if (!get_client_info_manager().has_sensor_record(m_client_id))
                        get_client_info_manager().remove_client_record(m_client_id);
 
@@ -415,18 +415,18 @@ bool command_worker::cmd_hello(void *payload)
        }
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to connect sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id);
+               _E("Permission denied to connect sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id);
                ret_value = OP_ERROR;
                goto out;
        }
 
-       DBG("Hello sensor [0x%llx], client id [%d]", m_sensor_id, m_client_id);
+       _D("Hello sensor [0x%llx], client id [%d]", m_sensor_id, m_client_id);
        get_client_info_manager().create_sensor_record(m_client_id, m_sensor_id);
-       INFO("New sensor record created for sensor [0x%llx], sensor name [%s] on client id [%d]\n", m_sensor_id, m_module->get_name(), m_client_id);
+       _I("New sensor record created for sensor [0x%llx], sensor name [%s] on client id [%d]\n", m_sensor_id, m_module->get_name(), m_client_id);
        ret_value = OP_SUCCESS;
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
@@ -436,15 +436,15 @@ bool command_worker::cmd_byebye(void *payload)
        long ret_value = OP_ERROR;
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to stop sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id);
+               _E("Permission denied to stop sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id);
                ret_value = OP_ERROR;
                goto out;
        }
 
-       DBG("CMD_BYEBYE for client [%d], sensor [0x%llx]", m_client_id, m_sensor_id);
+       _D("CMD_BYEBYE for client [%d], sensor [0x%llx]", m_client_id, m_sensor_id);
 
        if (!get_client_info_manager().remove_sensor_record(m_client_id, m_sensor_id)) {
-               ERR("Error removing sensor_record for client [%d]", m_client_id);
+               _E("Error removing sensor_record for client [%d]", m_client_id);
                ret_value = OP_ERROR;
                goto out;
        }
@@ -454,7 +454,7 @@ bool command_worker::cmd_byebye(void *payload)
 
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        if (ret_value == OP_SUCCESS)
                return false;
@@ -467,12 +467,12 @@ bool command_worker::cmd_start(void *payload)
        long ret_value = OP_ERROR;
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to start sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id);
+               _E("Permission denied to start sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id);
                ret_value = OP_ERROR;
                goto out;
        }
 
-       DBG("START Sensor [0x%llx], called from client [%d]", m_sensor_id, m_client_id);
+       _D("START Sensor [0x%llx], called from client [%d]", m_sensor_id, m_client_id);
 
        if (m_module->start()) {
                get_client_info_manager().set_start(m_client_id, m_sensor_id, true);
@@ -484,13 +484,13 @@ bool command_worker::cmd_start(void *payload)
                get_event_dispathcher().request_last_event(m_client_id, m_sensor_id);
                ret_value = OP_SUCCESS;
        } else {
-               ERR("Failed to start sensor [0x%llx] for client [%d]", m_sensor_id, m_client_id);
+               _E("Failed to start sensor [0x%llx] for client [%d]", m_sensor_id, m_client_id);
                ret_value = OP_ERROR;
        }
 
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
@@ -500,24 +500,24 @@ bool command_worker::cmd_stop(void *payload)
        long ret_value = OP_ERROR;
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to stop sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id);
+               _E("Permission denied to stop sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id);
                ret_value = OP_ERROR;
                goto out;
        }
 
-       DBG("STOP Sensor [0x%llx], called from client [%d]", m_sensor_id, m_client_id);
+       _D("STOP Sensor [0x%llx], called from client [%d]", m_sensor_id, m_client_id);
 
        if (m_module->stop()) {
                get_client_info_manager().set_start(m_client_id, m_sensor_id, false);
                ret_value = OP_SUCCESS;
        } else {
-               ERR("Failed to stop sensor [0x%llx] for client [%d]", m_sensor_id, m_client_id);
+               _E("Failed to stop sensor [0x%llx] for client [%d]", m_sensor_id, m_client_id);
                ret_value = OP_ERROR;
        }
 
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
@@ -530,14 +530,14 @@ bool command_worker::cmd_register_event(void *payload)
        cmd = (cmd_reg_t*)payload;
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to register event [0x%x] for client [%d] to client info manager",
+               _E("Permission denied to register event [0x%x] for client [%d] to client info manager",
                        cmd->event_type, m_client_id);
                ret_value = OP_ERROR;
                goto out;
        }
 
        if (!get_client_info_manager().register_event(m_client_id, m_sensor_id, cmd->event_type)) {
-               INFO("Failed to register event [0x%x] for client [%d] to client info manager",
+               _I("Failed to register event [0x%x] for client [%d] to client info manager",
                        cmd->event_type, m_client_id);
                ret_value = OP_ERROR;
                goto out;
@@ -546,11 +546,11 @@ bool command_worker::cmd_register_event(void *payload)
        insert_priority_list(cmd->event_type);
 
        ret_value = OP_SUCCESS;
-       DBG("Registering Event [0x%x] is done for client [%d]", cmd->event_type, m_client_id);
+       _D("Registering Event [0x%x] is done for client [%d]", cmd->event_type, m_client_id);
 
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
@@ -563,26 +563,26 @@ bool command_worker::cmd_unregister_event(void *payload)
        cmd = (cmd_unreg_t*)payload;
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to unregister event [0x%x] for client [%d] to client info manager",
+               _E("Permission denied to unregister event [0x%x] for client [%d] to client info manager",
                        cmd->event_type, m_client_id);
                ret_value = OP_ERROR;
                goto out;
        }
 
        if (!get_client_info_manager().unregister_event(m_client_id, m_sensor_id, cmd->event_type)) {
-               ERR("Failed to unregister event [0x%x] for client [%d] from client info manager",
+               _E("Failed to unregister event [0x%x] for client [%d] from client info manager",
                        cmd->event_type, m_client_id);
                ret_value = OP_ERROR;
                goto out;
        }
 
        ret_value = OP_SUCCESS;
-       DBG("Unregistering Event [0x%x] is done for client [%d]",
+       _D("Unregistering Event [0x%x] is done for client [%d]",
                cmd->event_type, m_client_id);
 
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
@@ -595,28 +595,28 @@ bool command_worker::cmd_set_batch(void *payload)
        cmd = (cmd_set_batch_t*)payload;
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to set batch for client [%d], for sensor [0x%llx] with batch [%d, %d] to client info manager",
+               _E("Permission denied to set batch for client [%d], for sensor [0x%llx] with batch [%d, %d] to client info manager",
                        m_client_id, m_sensor_id, cmd->interval, cmd->latency);
                ret_value = OP_ERROR;
                goto out;
        }
 
        if (!get_client_info_manager().set_batch(m_client_id, m_sensor_id, cmd->interval, cmd->latency)) {
-               ERR("Failed to set batch for client [%d], for sensor [0x%llx] with batch [%d, %d] to client info manager",
+               _E("Failed to set batch for client [%d], for sensor [0x%llx] with batch [%d, %d] to client info manager",
                        m_client_id, m_sensor_id, cmd->interval, cmd->latency);
                ret_value = OP_ERROR;
                goto out;
        }
 
        if (!m_module->add_interval(m_client_id, cmd->interval, false)) {
-               ERR("Failed to set interval for client [%d], for sensor [0x%llx] with interval [%d]",
+               _E("Failed to set interval for client [%d], for sensor [0x%llx] with interval [%d]",
                        m_client_id, m_sensor_id, cmd->interval);
                ret_value = OP_ERROR;
                goto out;
        }
 
        if (!m_module->add_batch(m_client_id, cmd->latency)) {
-               ERR("Failed to set latency for client [%d], for sensor [0x%llx] with latency [%d]",
+               _E("Failed to set latency for client [%d], for sensor [0x%llx] with latency [%d]",
                        m_client_id, m_sensor_id, cmd->latency);
                ret_value = OP_ERROR;
                goto out;
@@ -626,7 +626,7 @@ bool command_worker::cmd_set_batch(void *payload)
 
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
@@ -636,27 +636,27 @@ bool command_worker::cmd_unset_batch(void *payload)
        long ret_value = OP_ERROR;
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to unset batch for client [%d], for sensor [0x%llx] to client info manager",
+               _E("Permission denied to unset batch for client [%d], for sensor [0x%llx] to client info manager",
                        m_client_id, m_sensor_id);
                ret_value = OP_ERROR;
                goto out;
        }
 
        if (!get_client_info_manager().set_batch(m_client_id, m_sensor_id, 0, 0)) {
-               ERR("Failed to unset batch for client [%d], for sensor [0x%llx] to client info manager",
+               _E("Failed to unset batch for client [%d], for sensor [0x%llx] to client info manager",
                        m_client_id, m_sensor_id);
                ret_value = OP_ERROR;
                goto out;
        }
 
        if (!m_module->delete_interval(m_client_id, false)) {
-               ERR("Failed to delete interval for client [%d]", m_client_id);
+               _E("Failed to delete interval for client [%d]", m_client_id);
                ret_value = OP_ERROR;
                goto out;
        }
 
        if (!m_module->delete_batch(m_client_id)) {
-               ERR("Failed to delete latency for client [%d]", m_client_id);
+               _E("Failed to delete latency for client [%d]", m_client_id);
                ret_value = OP_ERROR;
                goto out;
        }
@@ -665,7 +665,7 @@ bool command_worker::cmd_unset_batch(void *payload)
 
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
@@ -678,14 +678,14 @@ bool command_worker::cmd_set_option(void *payload)
        cmd = (cmd_set_option_t*)payload;
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to set interval for client [%d], for sensor [0x%llx] with option [%d] to client info manager",
+               _E("Permission denied to set interval for client [%d], for sensor [0x%llx] with option [%d] to client info manager",
                        m_client_id, m_sensor_id, cmd->option);
                ret_value = OP_ERROR;
                goto out;
        }
 
        if (!get_client_info_manager().set_option(m_client_id, m_sensor_id, cmd->option)) {
-               ERR("Failed to set option for client [%d], for sensor [0x%llx] with option [%d] to client info manager",
+               _E("Failed to set option for client [%d], for sensor [0x%llx] with option [%d] to client info manager",
                        m_client_id, m_sensor_id, cmd->option);
                ret_value = OP_ERROR;
                goto out;
@@ -694,7 +694,7 @@ bool command_worker::cmd_set_option(void *payload)
        ret_value = OP_SUCCESS;
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
@@ -707,14 +707,14 @@ bool command_worker::cmd_set_wakeup(void *payload)
        cmd = (cmd_set_wakeup_t*)payload;
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to set wakeup for client [%d], for sensor [0x%llx] with wakeup [%d] to client info manager",
+               _E("Permission denied to set wakeup for client [%d], for sensor [0x%llx] with wakeup [%d] to client info manager",
                        m_client_id, m_sensor_id, cmd->wakeup);
                ret_value = OP_ERROR;
                goto out;
        }
 
        if (!get_client_info_manager().set_wakeup(m_client_id, m_sensor_id, cmd->wakeup)) {
-               ERR("Failed to set wakeup for client [%d], for sensor [0x%llx] with wakeup [%d] to client info manager",
+               _E("Failed to set wakeup for client [%d], for sensor [0x%llx] with wakeup [%d] to client info manager",
                        m_client_id, m_sensor_id, cmd->wakeup);
                ret_value = OP_ERROR;
                goto out;
@@ -724,7 +724,7 @@ bool command_worker::cmd_set_wakeup(void *payload)
 
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
@@ -738,10 +738,10 @@ bool command_worker::cmd_get_data(void *payload)
 
        sensor_data_t *data;
 
-       DBG("CMD_GET_VALUE Handler invoked\n");
+       _D("CMD_GET_VALUE Handler invoked\n");
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to get data for client [%d], for sensor [0x%llx]",
+               _E("Permission denied to get data for client [%d], for sensor [0x%llx]",
                        m_client_id, m_sensor_id);
                state = OP_ERROR;
                goto out;
@@ -770,7 +770,7 @@ bool command_worker::cmd_get_data(void *payload)
                }
 
                while ((state >= 0) && !data->timestamp && (retry++ < RETRY_CNT)) {
-                       INFO("Wait sensor[0x%llx] data updated for client [%d] #%d", m_sensor_id, m_client_id, retry);
+                       _I("Wait sensor[0x%llx] data updated for client [%d] #%d", m_sensor_id, m_client_id, retry);
                        usleep((retry == 1) ? INIT_WAIT_TIME : WAIT_TIME);
                        state = m_module->get_data(&data, &length);
                }
@@ -783,7 +783,7 @@ bool command_worker::cmd_get_data(void *payload)
                state = OP_ERROR;
 
        if (state <= 0) {
-               ERR("Failed to get data for client [%d], for sensor [0x%llx]",
+               _E("Failed to get data for client [%d], for sensor [0x%llx]",
                        m_client_id, m_sensor_id);
        }
 
@@ -798,12 +798,12 @@ bool command_worker::cmd_set_attribute_int(void *payload)
        cmd_set_attribute_int_t *cmd;
        long ret_value = OP_ERROR;
 
-       DBG("CMD_SET_COMMAND Handler invoked\n");
+       _D("CMD_SET_COMMAND Handler invoked\n");
 
        cmd = (cmd_set_attribute_int_t*)payload;
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to set command for client [%d], for sensor [0x%llx] with attribute [%d]",
+               _E("Permission denied to set command for client [%d], for sensor [0x%llx] with attribute [%d]",
                        m_client_id, m_sensor_id, cmd->attribute);
                ret_value = OP_ERROR;
                goto out;
@@ -813,7 +813,7 @@ bool command_worker::cmd_set_attribute_int(void *payload)
 
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
@@ -823,12 +823,12 @@ bool command_worker::cmd_set_attribute_str(void *payload)
        cmd_set_attribute_str_t *cmd;
        long ret_value = OP_ERROR;
 
-       DBG("CMD_SEND_SENSORHUB_DATA Handler invoked");
+       _D("CMD_SEND_SENSORHUB_DATA Handler invoked");
 
        cmd = (cmd_set_attribute_str_t*)payload;
 
        if (!is_permission_allowed()) {
-               ERR("Permission denied to send sensorhub_data for client [%d], for sensor [0x%llx]",
+               _E("Permission denied to send sensorhub_data for client [%d], for sensor [0x%llx]",
                        m_client_id, m_sensor_id);
                ret_value = OP_ERROR;
                goto out;
@@ -838,7 +838,7 @@ bool command_worker::cmd_set_attribute_str(void *payload)
 
 out:
        if (!send_cmd_done(ret_value))
-               ERR("Failed to send cmd_done to a client");
+               _E("Failed to send cmd_done to a client");
 
        return true;
 }
index 767f55a..bcf0bb2 100644 (file)
@@ -31,7 +31,7 @@ static void sig_term_handler(int signo, siginfo_t *info, void *data)
 
        get_proc_name(info->si_pid, proc_name);
 
-       ERR("Received SIGTERM(%d) from %s(%d)\n", signo, proc_name, info->si_pid);
+       _E("Received SIGTERM(%d) from %s(%d)\n", signo, proc_name, info->si_pid);
        exit(EXIT_SUCCESS);
 }
 
@@ -52,7 +52,7 @@ static void signal_init(void)
 
 int main(int argc, char *argv[])
 {
-       INFO("Sensord started");
+       _I("Sensord started");
 
        signal_init();
 
@@ -62,6 +62,6 @@ int main(int argc, char *argv[])
 
        server::get_instance().stop();
 
-       INFO("Sensord terminated");
+       _I("Sensord terminated");
        return 0;
 }
index 5a06dd9..9eb9e63 100644 (file)
@@ -42,7 +42,7 @@ static bool check_privilege_by_sockfd(int sock_fd, const char *priv)
        if (cynara_creds_socket_get_client(sock_fd, CLIENT_METHOD_DEFAULT, &client) != CYNARA_API_SUCCESS ||
                        cynara_creds_socket_get_user(sock_fd, USER_METHOD_DEFAULT, &user) != CYNARA_API_SUCCESS ||
                        (session = cynara_session_from_pid(pid)) == NULL) {
-               ERR("Getting client info failed");
+               _E("Getting client info failed");
                free(client);
                free(user);
                free(session);
@@ -86,11 +86,11 @@ void permission_checker::init()
        for (unsigned int i = 0; i < sensors.size(); ++i)
                m_permission_set |= sensors[i]->get_permission();
 
-       INFO("Permission Set = %d", m_permission_set);
+       _I("Permission Set = %d", m_permission_set);
 
        if (cynara_initialize(&cynara_env, NULL) != CYNARA_API_SUCCESS) {
                cynara_env = NULL;
-               ERR("Cynara initialization failed");
+               _E("Cynara initialization failed");
        }
 }
 
index 6410dd2..7d17901 100644 (file)
@@ -115,7 +115,7 @@ int physical_sensor::get_data(sensor_data_t **data, int *length)
        remains = m_sensor_device->get_data(m_handle.id, data, length);
 
        if (*length < 0) {
-               ERR("Failed to get sensor event");
+               _E("Failed to get sensor event");
                return -1;
        }
 
@@ -139,7 +139,7 @@ bool physical_sensor::set_interval(unsigned long interval)
        if (!m_sensor_device)
                return false;
 
-       INFO("Polling interval is set to %dms", interval);
+       _I("Polling interval is set to %dms", interval);
 
        return m_sensor_device->set_interval(m_handle.id, interval);
 }
@@ -151,7 +151,7 @@ bool physical_sensor::set_batch_latency(unsigned long latency)
        if (!m_sensor_device)
                return false;
 
-       INFO("Polling interval is set to %dms", latency);
+       _I("Polling interval is set to %dms", latency);
 
        return m_sensor_device->set_batch_latency(m_handle.id, latency);
 }
index fbff5d5..e819c2b 100644 (file)
@@ -63,25 +63,25 @@ auto_rotation_sensor::auto_rotation_sensor()
        virtual_sensor_config &config = virtual_sensor_config::get_instance();
 
        if (!config.get(SENSOR_TYPE_AUTO_ROTATION, ELEMENT_VENDOR, m_vendor)) {
-               ERR("[VENDOR] is empty\n");
+               _E("[VENDOR] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_vendor = %s", m_vendor.c_str());
+       _I("m_vendor = %s", m_vendor.c_str());
 
        if (!config.get(SENSOR_TYPE_AUTO_ROTATION, ELEMENT_RAW_DATA_UNIT, m_raw_data_unit)) {
-               ERR("[RAW_DATA_UNIT] is empty\n");
+               _E("[RAW_DATA_UNIT] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_raw_data_unit = %s", m_raw_data_unit.c_str());
+       _I("m_raw_data_unit = %s", m_raw_data_unit.c_str());
 
        if (!config.get(SENSOR_TYPE_AUTO_ROTATION, ELEMENT_DEFAULT_SAMPLING_TIME, &m_default_sampling_time)) {
-               ERR("[DEFAULT_SAMPLING_TIME] is empty\n");
+               _E("[DEFAULT_SAMPLING_TIME] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_default_sampling_time = %d", m_default_sampling_time);
+       _I("m_default_sampling_time = %d", m_default_sampling_time);
 
        m_interval = m_default_sampling_time * MS_TO_US;
 }
@@ -90,7 +90,7 @@ auto_rotation_sensor::~auto_rotation_sensor()
 {
        delete m_alg;
 
-       INFO("auto_rotation_sensor is destroyed!\n");
+       _I("auto_rotation_sensor is destroyed!\n");
 }
 
 bool auto_rotation_sensor::init(void)
@@ -98,21 +98,21 @@ bool auto_rotation_sensor::init(void)
        m_accel_sensor = sensor_loader::get_instance().get_sensor(ACCELEROMETER_SENSOR);
 
        if (!m_accel_sensor) {
-               ERR("cannot load accel sensor_hal from %s", get_name());
+               _E("cannot load accel sensor_hal from %s", get_name());
                return false;
        }
 
        m_alg = get_alg();
 
        if (!m_alg) {
-               ERR("Not supported AUTO ROTATION sensor");
+               _E("Not supported AUTO ROTATION sensor");
                return false;
        }
 
        if (!m_alg->open())
                return false;
 
-       INFO("%s is created!\n", get_name());
+       _I("%s is created!\n", get_name());
 
        return true;
 }
@@ -186,7 +186,7 @@ void auto_rotation_sensor::synthesize(const sensor_event_t& event)
 
        push(rotation_event);
 
-       DBG("Rotation: %d, ACC[0]: %f, ACC[1]: %f, ACC[2]: %f", rotation, event.data.values[0], event.data.values[1], event.data.values[2]);
+       _D("Rotation: %d, ACC[0]: %f, ACC[1]: %f, ACC[2]: %f", rotation, event.data.values[0], event.data.values[1], event.data.values[2]);
        return;
 }
 
index 98db53c..412f8b0 100644 (file)
@@ -83,74 +83,74 @@ fusion_sensor::fusion_sensor()
        m_enable_fusion = 0;
 
        if (!config.get(SENSOR_TYPE_FUSION, ELEMENT_VENDOR, m_vendor)) {
-               ERR("[VENDOR] is empty\n");
+               _E("[VENDOR] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_vendor = %s", m_vendor.c_str());
+       _I("m_vendor = %s", m_vendor.c_str());
 
        if (!config.get(SENSOR_TYPE_FUSION, ELEMENT_RAW_DATA_UNIT, m_raw_data_unit)) {
-               ERR("[RAW_DATA_UNIT] is empty\n");
+               _E("[RAW_DATA_UNIT] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_raw_data_unit = %s", m_raw_data_unit.c_str());
+       _I("m_raw_data_unit = %s", m_raw_data_unit.c_str());
 
        if (!config.get(SENSOR_TYPE_FUSION, ELEMENT_DEFAULT_SAMPLING_TIME, &m_default_sampling_time)) {
-               ERR("[DEFAULT_SAMPLING_TIME] is empty\n");
+               _E("[DEFAULT_SAMPLING_TIME] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_default_sampling_time = %d", m_default_sampling_time);
+       _I("m_default_sampling_time = %d", m_default_sampling_time);
 
        if (!config.get(SENSOR_TYPE_FUSION, ELEMENT_ACCEL_STATIC_BIAS, m_accel_static_bias, 3)) {
-               ERR("[ACCEL_STATIC_BIAS] is empty\n");
+               _E("[ACCEL_STATIC_BIAS] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_accel_static_bias = (%f, %f, %f)", m_accel_static_bias[0], m_accel_static_bias[1], m_accel_static_bias[2]);
+       _I("m_accel_static_bias = (%f, %f, %f)", m_accel_static_bias[0], m_accel_static_bias[1], m_accel_static_bias[2]);
 
        if (!config.get(SENSOR_TYPE_FUSION, ELEMENT_GYRO_STATIC_BIAS, m_gyro_static_bias,3)) {
-               ERR("[GYRO_STATIC_BIAS] is empty\n");
+               _E("[GYRO_STATIC_BIAS] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_gyro_static_bias = (%f, %f, %f)", m_gyro_static_bias[0], m_gyro_static_bias[1], m_gyro_static_bias[2]);
+       _I("m_gyro_static_bias = (%f, %f, %f)", m_gyro_static_bias[0], m_gyro_static_bias[1], m_gyro_static_bias[2]);
 
        if (!config.get(SENSOR_TYPE_FUSION, ELEMENT_GEOMAGNETIC_STATIC_BIAS, m_geomagnetic_static_bias, 3)) {
-               ERR("[GEOMAGNETIC_STATIC_BIAS] is empty\n");
+               _E("[GEOMAGNETIC_STATIC_BIAS] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_geomagnetic_static_bias = (%f, %f, %f)", m_geomagnetic_static_bias[0], m_geomagnetic_static_bias[1], m_geomagnetic_static_bias[2]);
+       _I("m_geomagnetic_static_bias = (%f, %f, %f)", m_geomagnetic_static_bias[0], m_geomagnetic_static_bias[1], m_geomagnetic_static_bias[2]);
 
        if (!config.get(SENSOR_TYPE_FUSION, ELEMENT_ACCEL_ROTATION_DIRECTION_COMPENSATION, m_accel_rotation_direction_compensation, 3)) {
-               ERR("[ACCEL_ROTATION_DIRECTION_COMPENSATION] is empty\n");
+               _E("[ACCEL_ROTATION_DIRECTION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_accel_rotation_direction_compensation = (%d, %d, %d)", m_accel_rotation_direction_compensation[0], m_accel_rotation_direction_compensation[1], m_accel_rotation_direction_compensation[2]);
+       _I("m_accel_rotation_direction_compensation = (%d, %d, %d)", m_accel_rotation_direction_compensation[0], m_accel_rotation_direction_compensation[1], m_accel_rotation_direction_compensation[2]);
 
        if (!config.get(SENSOR_TYPE_FUSION, ELEMENT_GYRO_ROTATION_DIRECTION_COMPENSATION, m_gyro_rotation_direction_compensation, 3)) {
-               ERR("[GYRO_ROTATION_DIRECTION_COMPENSATION] is empty\n");
+               _E("[GYRO_ROTATION_DIRECTION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_gyro_rotation_direction_compensation = (%d, %d, %d)", m_gyro_rotation_direction_compensation[0], m_gyro_rotation_direction_compensation[1], m_gyro_rotation_direction_compensation[2]);
+       _I("m_gyro_rotation_direction_compensation = (%d, %d, %d)", m_gyro_rotation_direction_compensation[0], m_gyro_rotation_direction_compensation[1], m_gyro_rotation_direction_compensation[2]);
 
        if (!config.get(SENSOR_TYPE_FUSION, ELEMENT_GEOMAGNETIC_ROTATION_DIRECTION_COMPENSATION, m_geomagnetic_rotation_direction_compensation, 3)) {
-               ERR("[GEOMAGNETIC_ROTATION_DIRECTION_COMPENSATION] is empty\n");
+               _E("[GEOMAGNETIC_ROTATION_DIRECTION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_geomagnetic_rotation_direction_compensation = (%d, %d, %d)", m_geomagnetic_rotation_direction_compensation[0], m_geomagnetic_rotation_direction_compensation[1], m_geomagnetic_rotation_direction_compensation[2]);
+       _I("m_geomagnetic_rotation_direction_compensation = (%d, %d, %d)", m_geomagnetic_rotation_direction_compensation[0], m_geomagnetic_rotation_direction_compensation[1], m_geomagnetic_rotation_direction_compensation[2]);
 
        if (!config.get(SENSOR_TYPE_FUSION, ELEMENT_MAGNETIC_ALIGNMENT_FACTOR, &m_magnetic_alignment_factor)) {
-               ERR("[MAGNETIC_ALIGNMENT_FACTOR] is empty\n");
+               _E("[MAGNETIC_ALIGNMENT_FACTOR] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_magnetic_alignment_factor = %d", m_magnetic_alignment_factor);
+       _I("m_magnetic_alignment_factor = %d", m_magnetic_alignment_factor);
 
        m_interval = m_default_sampling_time * MS_TO_US;
 
@@ -159,7 +159,7 @@ fusion_sensor::fusion_sensor()
 
 fusion_sensor::~fusion_sensor()
 {
-       INFO("fusion_sensor is destroyed!\n");
+       _I("fusion_sensor is destroyed!\n");
 }
 
 bool fusion_sensor::init(void)
@@ -169,17 +169,17 @@ bool fusion_sensor::init(void)
        m_magnetic_sensor = sensor_loader::get_instance().get_sensor(GEOMAGNETIC_SENSOR);
 
        if (!m_accel_sensor) {
-               ERR("Failed to load accel sensor: 0x%x", m_accel_sensor);
+               _E("Failed to load accel sensor: 0x%x", m_accel_sensor);
                return false;
        }
 
        if (!m_gyro_sensor)
-               INFO("Failed to load gyro sensor: 0x%x", m_gyro_sensor);
+               _I("Failed to load gyro sensor: 0x%x", m_gyro_sensor);
 
        if (!m_magnetic_sensor)
-               INFO("Failed to load geomagnetic sensor: 0x%x", m_magnetic_sensor);
+               _I("Failed to load geomagnetic sensor: 0x%x", m_magnetic_sensor);
 
-       INFO("%s is created!", sensor_base::get_name());
+       _I("%s is created!", sensor_base::get_name());
        return true;
 }
 
index 390169f..4cfc528 100644 (file)
@@ -78,67 +78,67 @@ gravity_sensor::gravity_sensor()
        register_supported_event(GRAVITY_RAW_DATA_EVENT);
 
        if (!config.get(SENSOR_TYPE_GRAVITY, ELEMENT_VENDOR, m_vendor)) {
-               ERR("[VENDOR] is empty\n");
+               _E("[VENDOR] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_vendor = %s", m_vendor.c_str());
+       _I("m_vendor = %s", m_vendor.c_str());
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_ORIENTATION_DATA_UNIT, m_orientation_data_unit)) {
-               ERR("[ORIENTATION_DATA_UNIT] is empty\n");
+               _E("[ORIENTATION_DATA_UNIT] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_orientation_data_unit = %s", m_orientation_data_unit.c_str());
+       _I("m_orientation_data_unit = %s", m_orientation_data_unit.c_str());
 
        if (!config.get(SENSOR_TYPE_GRAVITY, ELEMENT_RAW_DATA_UNIT, m_raw_data_unit)) {
-               ERR("[RAW_DATA_UNIT] is empty\n");
+               _E("[RAW_DATA_UNIT] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_raw_data_unit = %s", m_raw_data_unit.c_str());
+       _I("m_raw_data_unit = %s", m_raw_data_unit.c_str());
 
        if (!config.get(SENSOR_TYPE_GRAVITY, ELEMENT_DEFAULT_SAMPLING_TIME, &m_default_sampling_time)) {
-               ERR("[DEFAULT_SAMPLING_TIME] is empty\n");
+               _E("[DEFAULT_SAMPLING_TIME] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_default_sampling_time = %d", m_default_sampling_time);
+       _I("m_default_sampling_time = %d", m_default_sampling_time);
 
        if (!config.get(SENSOR_TYPE_GRAVITY, ELEMENT_GRAVITY_SIGN_COMPENSATION, m_gravity_sign_compensation, 3)) {
-               ERR("[GRAVITY_SIGN_COMPENSATION] is empty\n");
+               _E("[GRAVITY_SIGN_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_gravity_sign_compensation = (%d, %d, %d)", m_gravity_sign_compensation[0], m_gravity_sign_compensation[1], m_gravity_sign_compensation[2]);
+       _I("m_gravity_sign_compensation = (%d, %d, %d)", m_gravity_sign_compensation[0], m_gravity_sign_compensation[1], m_gravity_sign_compensation[2]);
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_AZIMUTH_ROTATION_COMPENSATION, &m_azimuth_rotation_compensation)) {
-               ERR("[AZIMUTH_ROTATION_COMPENSATION] is empty\n");
+               _E("[AZIMUTH_ROTATION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_azimuth_rotation_compensation = %d", m_azimuth_rotation_compensation);
+       _I("m_azimuth_rotation_compensation = %d", m_azimuth_rotation_compensation);
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_PITCH_ROTATION_COMPENSATION, &m_pitch_rotation_compensation)) {
-               ERR("[PITCH_ROTATION_COMPENSATION] is empty\n");
+               _E("[PITCH_ROTATION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_pitch_rotation_compensation = %d", m_pitch_rotation_compensation);
+       _I("m_pitch_rotation_compensation = %d", m_pitch_rotation_compensation);
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_ROLL_ROTATION_COMPENSATION, &m_roll_rotation_compensation)) {
-               ERR("[ROLL_ROTATION_COMPENSATION] is empty\n");
+               _E("[ROLL_ROTATION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_roll_rotation_compensation = %d", m_roll_rotation_compensation);
+       _I("m_roll_rotation_compensation = %d", m_roll_rotation_compensation);
 
        m_interval = m_default_sampling_time * MS_TO_US;
 }
 
 gravity_sensor::~gravity_sensor()
 {
-       INFO("gravity_sensor is destroyed!\n");
+       _I("gravity_sensor is destroyed!\n");
 }
 
 bool gravity_sensor::init()
@@ -150,12 +150,12 @@ bool gravity_sensor::init()
        m_fusion_sensor = sensor_loader::get_instance().get_sensor(FUSION_SENSOR);
 
        if (!m_accel_sensor || !m_gyro_sensor || !m_magnetic_sensor || !m_fusion_sensor) {
-               ERR("Failed to load sensors,  accel: 0x%x, gyro: 0x%x, mag: 0x%x, fusion: 0x%x",
+               _E("Failed to load sensors,  accel: 0x%x, gyro: 0x%x, mag: 0x%x, fusion: 0x%x",
                        m_accel_sensor, m_gyro_sensor, m_magnetic_sensor, m_fusion_sensor);
                return false;
        }
 
-       INFO("%s is created!", sensor_base::get_name());
+       _I("%s is created!", sensor_base::get_name());
        return true;
 }
 
index 93f4086..6a43e75 100644 (file)
@@ -88,79 +88,79 @@ linear_accel_sensor::linear_accel_sensor()
 
 
        if (!config.get(SENSOR_TYPE_LINEAR_ACCEL, ELEMENT_VENDOR, m_vendor)) {
-               ERR("[VENDOR] is empty\n");
+               _E("[VENDOR] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_vendor = %s", m_vendor.c_str());
+       _I("m_vendor = %s", m_vendor.c_str());
 
        if (!config.get(SENSOR_TYPE_LINEAR_ACCEL, ELEMENT_RAW_DATA_UNIT, m_raw_data_unit)) {
-               ERR("[RAW_DATA_UNIT] is empty\n");
+               _E("[RAW_DATA_UNIT] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_raw_data_unit = %s", m_raw_data_unit.c_str());
+       _I("m_raw_data_unit = %s", m_raw_data_unit.c_str());
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_ORIENTATION_DATA_UNIT, m_orientation_data_unit)) {
-               ERR("[ORIENTATION_DATA_UNIT] is empty\n");
+               _E("[ORIENTATION_DATA_UNIT] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_orientation_data_unit = %s", m_orientation_data_unit.c_str());
+       _I("m_orientation_data_unit = %s", m_orientation_data_unit.c_str());
 
        if (!config.get(SENSOR_TYPE_LINEAR_ACCEL, ELEMENT_DEFAULT_SAMPLING_TIME, &m_default_sampling_time)) {
-               ERR("[DEFAULT_SAMPLING_TIME] is empty\n");
+               _E("[DEFAULT_SAMPLING_TIME] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_default_sampling_time = %d", m_default_sampling_time);
+       _I("m_default_sampling_time = %d", m_default_sampling_time);
 
        if (!config.get(SENSOR_TYPE_LINEAR_ACCEL, ELEMENT_ACCEL_STATIC_BIAS, m_accel_static_bias, 3)) {
-               ERR("[ACCEL_STATIC_BIAS] is empty\n");
+               _E("[ACCEL_STATIC_BIAS] is empty\n");
                throw ENXIO;
        }
 
        if (!config.get(SENSOR_TYPE_LINEAR_ACCEL, ELEMENT_ACCEL_ROTATION_DIRECTION_COMPENSATION, m_accel_rotation_direction_compensation, 3)) {
-               ERR("[ACCEL_ROTATION_DIRECTION_COMPENSATION] is empty\n");
+               _E("[ACCEL_ROTATION_DIRECTION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_accel_rotation_direction_compensation = (%d, %d, %d)", m_accel_rotation_direction_compensation[0], m_accel_rotation_direction_compensation[1], m_accel_rotation_direction_compensation[2]);
+       _I("m_accel_rotation_direction_compensation = (%d, %d, %d)", m_accel_rotation_direction_compensation[0], m_accel_rotation_direction_compensation[1], m_accel_rotation_direction_compensation[2]);
 
        if (!config.get(SENSOR_TYPE_GRAVITY, ELEMENT_GRAVITY_SIGN_COMPENSATION, m_gravity_sign_compensation, 3)) {
-               ERR("[GRAVITY_SIGN_COMPENSATION] is empty\n");
+               _E("[GRAVITY_SIGN_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_gravity_sign_compensation = (%d, %d, %d)", m_gravity_sign_compensation[0], m_gravity_sign_compensation[1], m_gravity_sign_compensation[2]);
+       _I("m_gravity_sign_compensation = (%d, %d, %d)", m_gravity_sign_compensation[0], m_gravity_sign_compensation[1], m_gravity_sign_compensation[2]);
 
        if (!config.get(SENSOR_TYPE_LINEAR_ACCEL, ELEMENT_LINEAR_ACCEL_SIGN_COMPENSATION, m_linear_accel_sign_compensation, 3)) {
-               ERR("[LINEAR_ACCEL_SIGN_COMPENSATION] is empty\n");
+               _E("[LINEAR_ACCEL_SIGN_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_linear_accel_sign_compensation = (%d, %d, %d)", m_linear_accel_sign_compensation[0], m_linear_accel_sign_compensation[1], m_linear_accel_sign_compensation[2]);
+       _I("m_linear_accel_sign_compensation = (%d, %d, %d)", m_linear_accel_sign_compensation[0], m_linear_accel_sign_compensation[1], m_linear_accel_sign_compensation[2]);
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_AZIMUTH_ROTATION_COMPENSATION, &m_azimuth_rotation_compensation)) {
-               ERR("[AZIMUTH_ROTATION_COMPENSATION] is empty\n");
+               _E("[AZIMUTH_ROTATION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_azimuth_rotation_compensation = %d", m_azimuth_rotation_compensation);
+       _I("m_azimuth_rotation_compensation = %d", m_azimuth_rotation_compensation);
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_PITCH_ROTATION_COMPENSATION, &m_pitch_rotation_compensation)) {
-               ERR("[PITCH_ROTATION_COMPENSATION] is empty\n");
+               _E("[PITCH_ROTATION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_pitch_rotation_compensation = %d", m_pitch_rotation_compensation);
+       _I("m_pitch_rotation_compensation = %d", m_pitch_rotation_compensation);
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_ROLL_ROTATION_COMPENSATION, &m_roll_rotation_compensation)) {
-               ERR("[ROLL_ROTATION_COMPENSATION] is empty\n");
+               _E("[ROLL_ROTATION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_roll_rotation_compensation = %d", m_roll_rotation_compensation);
+       _I("m_roll_rotation_compensation = %d", m_roll_rotation_compensation);
 
        m_interval = m_default_sampling_time * MS_TO_US;
 
@@ -168,7 +168,7 @@ linear_accel_sensor::linear_accel_sensor()
 
 linear_accel_sensor::~linear_accel_sensor()
 {
-       INFO("linear_accel_sensor is destroyed!\n");
+       _I("linear_accel_sensor is destroyed!\n");
 }
 
 bool linear_accel_sensor::init()
@@ -180,12 +180,12 @@ bool linear_accel_sensor::init()
        m_fusion_sensor = sensor_loader::get_instance().get_sensor(FUSION_SENSOR);
 
        if (!m_accel_sensor || !m_gyro_sensor || !m_magnetic_sensor || !m_fusion_sensor) {
-               ERR("Failed to load sensors,  accel: 0x%x, gyro: 0x%x, mag: 0x%x, fusion: 0x%x",
+               _E("Failed to load sensors,  accel: 0x%x, gyro: 0x%x, mag: 0x%x, fusion: 0x%x",
                        m_accel_sensor, m_gyro_sensor, m_magnetic_sensor, m_fusion_sensor);
                return false;
        }
 
-       INFO("%s is created!", sensor_base::get_name());
+       _I("%s is created!", sensor_base::get_name());
        return true;
 }
 
index 911b7f3..3bd6047 100644 (file)
@@ -73,53 +73,53 @@ orientation_sensor::orientation_sensor()
        register_supported_event(ORIENTATION_RAW_DATA_EVENT);
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_VENDOR, m_vendor)) {
-               ERR("[VENDOR] is empty\n");
+               _E("[VENDOR] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_vendor = %s", m_vendor.c_str());
+       _I("m_vendor = %s", m_vendor.c_str());
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_RAW_DATA_UNIT, m_raw_data_unit)) {
-               ERR("[RAW_DATA_UNIT] is empty\n");
+               _E("[RAW_DATA_UNIT] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_raw_data_unit = %s", m_raw_data_unit.c_str());
+       _I("m_raw_data_unit = %s", m_raw_data_unit.c_str());
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_DEFAULT_SAMPLING_TIME, &m_default_sampling_time)) {
-               ERR("[DEFAULT_SAMPLING_TIME] is empty\n");
+               _E("[DEFAULT_SAMPLING_TIME] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_default_sampling_time = %d", m_default_sampling_time);
+       _I("m_default_sampling_time = %d", m_default_sampling_time);
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_AZIMUTH_ROTATION_COMPENSATION, &m_azimuth_rotation_compensation)) {
-               ERR("[AZIMUTH_ROTATION_COMPENSATION] is empty\n");
+               _E("[AZIMUTH_ROTATION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_azimuth_rotation_compensation = %d", m_azimuth_rotation_compensation);
+       _I("m_azimuth_rotation_compensation = %d", m_azimuth_rotation_compensation);
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_PITCH_ROTATION_COMPENSATION, &m_pitch_rotation_compensation)) {
-               ERR("[PITCH_ROTATION_COMPENSATION] is empty\n");
+               _E("[PITCH_ROTATION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_pitch_rotation_compensation = %d", m_pitch_rotation_compensation);
+       _I("m_pitch_rotation_compensation = %d", m_pitch_rotation_compensation);
 
        if (!config.get(SENSOR_TYPE_ORIENTATION, ELEMENT_ROLL_ROTATION_COMPENSATION, &m_roll_rotation_compensation)) {
-               ERR("[ROLL_ROTATION_COMPENSATION] is empty\n");
+               _E("[ROLL_ROTATION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_roll_rotation_compensation = %d", m_roll_rotation_compensation);
+       _I("m_roll_rotation_compensation = %d", m_roll_rotation_compensation);
 
        m_interval = m_default_sampling_time * MS_TO_US;
 }
 
 orientation_sensor::~orientation_sensor()
 {
-       INFO("orientation_sensor is destroyed!\n");
+       _I("orientation_sensor is destroyed!\n");
 }
 
 bool orientation_sensor::init(void)
@@ -131,12 +131,12 @@ bool orientation_sensor::init(void)
        m_fusion_sensor = sensor_loader::get_instance().get_sensor(FUSION_SENSOR);
 
        if (!m_accel_sensor || !m_gyro_sensor || !m_magnetic_sensor || !m_fusion_sensor) {
-               ERR("Failed to load sensors,  accel: 0x%x, gyro: 0x%x, mag: 0x%x, fusion: 0x%x",
+               _E("Failed to load sensors,  accel: 0x%x, gyro: 0x%x, mag: 0x%x, fusion: 0x%x",
                        m_accel_sensor, m_gyro_sensor, m_magnetic_sensor, m_fusion_sensor);
                return false;
        }
 
-       INFO("%s is created!\n", sensor_base::get_name());
+       _I("%s is created!\n", sensor_base::get_name());
 
        return true;
 }
index 4d022c7..0296707 100644 (file)
@@ -70,60 +70,60 @@ gaming_rv_sensor::gaming_rv_sensor()
        else
                m_hardware_fusion = true;
 
-       INFO("m_hardware_fusion = %d", m_hardware_fusion);
+       _I("m_hardware_fusion = %d", m_hardware_fusion);
 
        m_name = string(SENSOR_NAME);
        register_supported_event(GAMING_RV_RAW_DATA_EVENT);
        m_enable_gaming_rv = 0;
 
        if (!config.get(SENSOR_TYPE_GAMING_RV, ELEMENT_VENDOR, m_vendor)) {
-               ERR("[VENDOR] is empty\n");
+               _E("[VENDOR] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_vendor = %s", m_vendor.c_str());
+       _I("m_vendor = %s", m_vendor.c_str());
 
        if (!config.get(SENSOR_TYPE_GAMING_RV, ELEMENT_DEFAULT_SAMPLING_TIME, &m_default_sampling_time)) {
-               ERR("[DEFAULT_SAMPLING_TIME] is empty\n");
+               _E("[DEFAULT_SAMPLING_TIME] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_default_sampling_time = %d", m_default_sampling_time);
+       _I("m_default_sampling_time = %d", m_default_sampling_time);
 
        if (!config.get(SENSOR_TYPE_GAMING_RV, ELEMENT_ACCEL_STATIC_BIAS, m_accel_static_bias, 3)) {
-               ERR("[ACCEL_STATIC_BIAS] is empty\n");
+               _E("[ACCEL_STATIC_BIAS] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_accel_static_bias = (%f, %f, %f)", m_accel_static_bias[0], m_accel_static_bias[1], m_accel_static_bias[2]);
+       _I("m_accel_static_bias = (%f, %f, %f)", m_accel_static_bias[0], m_accel_static_bias[1], m_accel_static_bias[2]);
 
        if (!config.get(SENSOR_TYPE_GAMING_RV, ELEMENT_GYRO_STATIC_BIAS, m_gyro_static_bias,3)) {
-               ERR("[GYRO_STATIC_BIAS] is empty\n");
+               _E("[GYRO_STATIC_BIAS] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_gyro_static_bias = (%f, %f, %f)", m_gyro_static_bias[0], m_gyro_static_bias[1], m_gyro_static_bias[2]);
+       _I("m_gyro_static_bias = (%f, %f, %f)", m_gyro_static_bias[0], m_gyro_static_bias[1], m_gyro_static_bias[2]);
 
        if (!config.get(SENSOR_TYPE_GAMING_RV, ELEMENT_ACCEL_ROTATION_DIRECTION_COMPENSATION, m_accel_rotation_direction_compensation, 3)) {
-               ERR("[ACCEL_ROTATION_DIRECTION_COMPENSATION] is empty\n");
+               _E("[ACCEL_ROTATION_DIRECTION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_accel_rotation_direction_compensation = (%d, %d, %d)", m_accel_rotation_direction_compensation[0], m_accel_rotation_direction_compensation[1], m_accel_rotation_direction_compensation[2]);
+       _I("m_accel_rotation_direction_compensation = (%d, %d, %d)", m_accel_rotation_direction_compensation[0], m_accel_rotation_direction_compensation[1], m_accel_rotation_direction_compensation[2]);
 
        if (!config.get(SENSOR_TYPE_GAMING_RV, ELEMENT_GYRO_ROTATION_DIRECTION_COMPENSATION, m_gyro_rotation_direction_compensation, 3)) {
-               ERR("[GYRO_ROTATION_DIRECTION_COMPENSATION] is empty\n");
+               _E("[GYRO_ROTATION_DIRECTION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_gyro_rotation_direction_compensation = (%d, %d, %d)", m_gyro_rotation_direction_compensation[0], m_gyro_rotation_direction_compensation[1], m_gyro_rotation_direction_compensation[2]);
+       _I("m_gyro_rotation_direction_compensation = (%d, %d, %d)", m_gyro_rotation_direction_compensation[0], m_gyro_rotation_direction_compensation[1], m_gyro_rotation_direction_compensation[2]);
 
        m_interval = m_default_sampling_time * MS_TO_US;
 }
 
 gaming_rv_sensor::~gaming_rv_sensor()
 {
-       INFO("gaming_rv_sensor is destroyed!\n");
+       _I("gaming_rv_sensor is destroyed!\n");
 }
 
 bool gaming_rv_sensor::init()
@@ -132,12 +132,12 @@ bool gaming_rv_sensor::init()
        m_gyro_sensor = sensor_loader::get_instance().get_sensor(GYROSCOPE_SENSOR);
 
        if (!m_accel_sensor || !m_gyro_sensor) {
-               ERR("Failed to load sensors,  accel: 0x%x, gyro: 0x%x",
+               _E("Failed to load sensors,  accel: 0x%x, gyro: 0x%x",
                        m_accel_sensor, m_gyro_sensor);
                return false;
        }
 
-       INFO("%s is created!\n", sensor_base::get_name());
+       _I("%s is created!\n", sensor_base::get_name());
 
        return true;
 }
index 6f1e606..6ca994c 100644 (file)
@@ -62,25 +62,25 @@ geomagnetic_rv_sensor::geomagnetic_rv_sensor()
        register_supported_event(GEOMAGNETIC_RV_RAW_DATA_EVENT);
 
        if (!config.get(SENSOR_TYPE_GEOMAGNETIC_RV, ELEMENT_VENDOR, m_vendor)) {
-               ERR("[VENDOR] is empty\n");
+               _E("[VENDOR] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_vendor = %s", m_vendor.c_str());
+       _I("m_vendor = %s", m_vendor.c_str());
 
        if (!config.get(SENSOR_TYPE_GEOMAGNETIC_RV, ELEMENT_DEFAULT_SAMPLING_TIME, &m_default_sampling_time)) {
-               ERR("[DEFAULT_SAMPLING_TIME] is empty\n");
+               _E("[DEFAULT_SAMPLING_TIME] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_default_sampling_time = %d", m_default_sampling_time);
+       _I("m_default_sampling_time = %d", m_default_sampling_time);
 
        m_interval = m_default_sampling_time * MS_TO_US;
 }
 
 geomagnetic_rv_sensor::~geomagnetic_rv_sensor()
 {
-       INFO("geomagnetic_rv_sensor is destroyed!\n");
+       _I("geomagnetic_rv_sensor is destroyed!\n");
 }
 
 bool geomagnetic_rv_sensor::init()
@@ -91,12 +91,12 @@ bool geomagnetic_rv_sensor::init()
        m_fusion_sensor = sensor_loader::get_instance().get_sensor(FUSION_SENSOR);
 
        if (!m_accel_sensor || !m_magnetic_sensor || !m_fusion_sensor) {
-               ERR("Failed to load sensors,  accel: 0x%x, mag: 0x%x, fusion: 0x%x",
+               _E("Failed to load sensors,  accel: 0x%x, mag: 0x%x, fusion: 0x%x",
                        m_accel_sensor, m_magnetic_sensor, m_fusion_sensor);
                return false;
        }
 
-       INFO("%s is created!\n", sensor_base::get_name());
+       _I("%s is created!\n", sensor_base::get_name());
 
        return true;
 }
index f00ffef..1fc7db0 100644 (file)
@@ -69,25 +69,25 @@ rv_sensor::rv_sensor()
        m_enable_orientation = 0;
 
        if (!config.get(SENSOR_TYPE_RV, ELEMENT_VENDOR, m_vendor)) {
-               ERR("[VENDOR] is empty\n");
+               _E("[VENDOR] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_vendor = %s", m_vendor.c_str());
+       _I("m_vendor = %s", m_vendor.c_str());
 
        if (!config.get(SENSOR_TYPE_RV, ELEMENT_DEFAULT_SAMPLING_TIME, &m_default_sampling_time)) {
-               ERR("[DEFAULT_SAMPLING_TIME] is empty\n");
+               _E("[DEFAULT_SAMPLING_TIME] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_default_sampling_time = %d", m_default_sampling_time);
+       _I("m_default_sampling_time = %d", m_default_sampling_time);
 
        m_interval = m_default_sampling_time * MS_TO_US;
 }
 
 rv_sensor::~rv_sensor()
 {
-       INFO("rv_sensor is destroyed!\n");
+       _I("rv_sensor is destroyed!\n");
 }
 
 bool rv_sensor::init()
@@ -99,12 +99,12 @@ bool rv_sensor::init()
        m_fusion_sensor = sensor_loader::get_instance().get_sensor(FUSION_SENSOR);
 
        if (!m_accel_sensor || !m_gyro_sensor || !m_magnetic_sensor || !m_fusion_sensor) {
-               ERR("Failed to load sensors,  accel: 0x%x, gyro: 0x%x, mag: 0x%x, fusion: 0x%x",
+               _E("Failed to load sensors,  accel: 0x%x, gyro: 0x%x, mag: 0x%x, fusion: 0x%x",
                        m_accel_sensor, m_gyro_sensor, m_magnetic_sensor, m_fusion_sensor);
                return false;
        }
 
-       INFO("%s is created!\n", sensor_base::get_name());
+       _I("%s is created!\n", sensor_base::get_name());
 
        return true;
 }
index cab3520..8b1af3c 100644 (file)
@@ -63,39 +63,39 @@ tilt_sensor::tilt_sensor()
        register_supported_event(TILT_RAW_DATA_EVENT);
 
        if (!config.get(SENSOR_TYPE_TILT, ELEMENT_VENDOR, m_vendor)) {
-               ERR("[VENDOR] is empty\n");
+               _E("[VENDOR] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_vendor = %s", m_vendor.c_str());
+       _I("m_vendor = %s", m_vendor.c_str());
 
        if (!config.get(SENSOR_TYPE_TILT, ELEMENT_RAW_DATA_UNIT, m_raw_data_unit)) {
-               ERR("[RAW_DATA_UNIT] is empty\n");
+               _E("[RAW_DATA_UNIT] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_raw_data_unit = %s", m_raw_data_unit.c_str());
+       _I("m_raw_data_unit = %s", m_raw_data_unit.c_str());
 
        if (!config.get(SENSOR_TYPE_TILT, ELEMENT_DEFAULT_SAMPLING_TIME, &m_default_sampling_time)) {
-               ERR("[DEFAULT_SAMPLING_TIME] is empty\n");
+               _E("[DEFAULT_SAMPLING_TIME] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_default_sampling_time = %d", m_default_sampling_time);
+       _I("m_default_sampling_time = %d", m_default_sampling_time);
 
        if (!config.get(SENSOR_TYPE_TILT, ELEMENT_PITCH_ROTATION_COMPENSATION, &m_pitch_rotation_compensation)) {
-               ERR("[PITCH_ROTATION_COMPENSATION] is empty\n");
+               _E("[PITCH_ROTATION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_pitch_rotation_compensation = %d", m_pitch_rotation_compensation);
+       _I("m_pitch_rotation_compensation = %d", m_pitch_rotation_compensation);
 
        if (!config.get(SENSOR_TYPE_TILT, ELEMENT_ROLL_ROTATION_COMPENSATION, &m_roll_rotation_compensation)) {
-               ERR("[ROLL_ROTATION_COMPENSATION] is empty\n");
+               _E("[ROLL_ROTATION_COMPENSATION] is empty\n");
                throw ENXIO;
        }
 
-       INFO("m_roll_rotation_compensation = %d", m_roll_rotation_compensation);
+       _I("m_roll_rotation_compensation = %d", m_roll_rotation_compensation);
 
        m_interval = m_default_sampling_time * MS_TO_US;
 
@@ -103,7 +103,7 @@ tilt_sensor::tilt_sensor()
 
 tilt_sensor::~tilt_sensor()
 {
-       INFO("tilt_sensor is destroyed!\n");
+       _I("tilt_sensor is destroyed!\n");
 }
 
 bool tilt_sensor::init(void)
@@ -112,12 +112,12 @@ bool tilt_sensor::init(void)
        m_fusion_sensor = sensor_loader::get_instance().get_sensor(FUSION_SENSOR);
 
        if (!m_accel_sensor || !m_fusion_sensor) {
-               ERR("Failed to load sensors,  accel: 0x%x, fusion: 0x%x",
+               _E("Failed to load sensors,  accel: 0x%x, fusion: 0x%x",
                        m_accel_sensor, m_fusion_sensor);
                return false;
        }
 
-       INFO("%s is created!\n", sensor_base::get_name());
+       _I("%s is created!\n", sensor_base::get_name());
 
        return true;
 }
index cee362f..654ac97 100644 (file)
@@ -106,14 +106,14 @@ bool sensor_base::start()
 
        if (m_client == 1) {
                if (!on_start()) {
-                       ERR("[%s] sensor failed to start", get_name());
+                       _E("[%s] sensor failed to start", get_name());
                        return false;
                }
 
                m_started = true;
        }
 
-       INFO("[%s] sensor started, #client = %d", get_name(), m_client);
+       _I("[%s] sensor started, #client = %d", get_name(), m_client);
 
        return true;
 }
@@ -126,14 +126,14 @@ bool sensor_base::stop(void)
 
        if (m_client == 0) {
                if (!on_stop()) {
-                       ERR("[%s] sensor faild to stop", get_name());
+                       _E("[%s] sensor faild to stop", get_name());
                        return false;
                }
 
                m_started = false;
        }
 
-       INFO("[%s] sensor stopped, #client = %d", get_name(), m_client);
+       _I("[%s] sensor stopped, #client = %d", get_name(), m_client);
 
        return true;
 }
@@ -159,7 +159,7 @@ bool sensor_base::add_interval(int client_id, unsigned int interval, bool is_pro
        cur_min = m_plugin_info_list.get_min_interval();
 
        if (cur_min != prev_min) {
-               INFO("Min interval for sensor[0x%llx] is changed from %dms to %dms"
+               _I("Min interval for sensor[0x%llx] is changed from %dms to %dms"
                        " by%sclient[%d] adding interval",
                        get_id(), prev_min, cur_min,
                        is_processor ? " processor " : " ", client_id);
@@ -183,14 +183,14 @@ bool sensor_base::delete_interval(int client_id, bool is_processor)
        cur_min = m_plugin_info_list.get_min_interval();
 
        if (!cur_min) {
-               INFO("No interval for sensor[0x%llx] by%sclient[%d] deleting interval, "
+               _I("No interval for sensor[0x%llx] by%sclient[%d] deleting interval, "
                         "so set to default %dms",
                         get_id(), is_processor ? " processor " : " ",
                         client_id, POLL_1HZ_MS);
 
                set_interval(POLL_1HZ_MS);
        } else if (cur_min != prev_min) {
-               INFO("Min interval for sensor[0x%llx] is changed from %dms to %dms"
+               _I("Min interval for sensor[0x%llx] is changed from %dms to %dms"
                        " by%sclient[%d] deleting interval",
                        get_id(), prev_min, cur_min,
                        is_processor ? " processor " : " ", client_id);
@@ -222,7 +222,7 @@ bool sensor_base::add_batch(int client_id, unsigned int latency)
        cur_max = m_plugin_info_list.get_max_batch();
 
        if (cur_max != prev_max) {
-               INFO("Max latency for sensor[0x%llx] is changed from %dms to %dms by client[%d] adding latency",
+               _I("Max latency for sensor[0x%llx] is changed from %dms to %dms by client[%d] adding latency",
                        get_id(), prev_max, cur_max, client_id);
                set_batch_latency(cur_max);
        }
@@ -243,12 +243,12 @@ bool sensor_base::delete_batch(int client_id)
        cur_max = m_plugin_info_list.get_max_batch();
 
        if (!cur_max) {
-               INFO("No latency for sensor[0x%llx] by client[%d] deleting latency, so set to default 0 ms",
+               _I("No latency for sensor[0x%llx] by client[%d] deleting latency, so set to default 0 ms",
                         get_id(), client_id);
 
                set_batch_latency(0);
        } else if (cur_max != prev_max) {
-               INFO("Max latency for sensor[0x%llx] is changed from %dms to %dms by client[%d] deleting latency",
+               _I("Max latency for sensor[0x%llx] is changed from %dms to %dms by client[%d] deleting latency",
                        get_id(), prev_max, cur_max, client_id);
 
                set_batch_latency(cur_max);
@@ -278,7 +278,7 @@ bool sensor_base::add_wakeup(int client_id, int wakeup)
        cur_wakeup = m_plugin_info_list.is_wakeup_on();
 
        if ((cur_wakeup == SENSOR_WAKEUP_ON) && (prev_wakeup < SENSOR_WAKEUP_ON)) {
-               INFO("Wakeup for sensor[0x%llx] is changed from %d to %d by client[%d] adding wakeup",
+               _I("Wakeup for sensor[0x%llx] is changed from %d to %d by client[%d] adding wakeup",
                        get_id(), prev_wakeup, cur_wakeup, client_id);
                set_wakeup(SENSOR_WAKEUP_ON);
        }
@@ -299,7 +299,7 @@ bool sensor_base::delete_wakeup(int client_id)
        cur_wakeup = m_plugin_info_list.is_wakeup_on();
 
        if ((cur_wakeup < SENSOR_WAKEUP_ON) && (prev_wakeup == SENSOR_WAKEUP_ON)) {
-               INFO("Wakeup for sensor[0x%llx] is changed from %d to %d by client[%d] deleting wakeup",
+               _I("Wakeup for sensor[0x%llx] is changed from %d to %d by client[%d] deleting wakeup",
                        get_id(), prev_wakeup, cur_wakeup, client_id);
                set_wakeup(SENSOR_WAKEUP_OFF);
        }
@@ -375,7 +375,7 @@ unsigned long long sensor_base::get_timestamp(void)
 unsigned long long sensor_base::get_timestamp(timeval *t)
 {
        if (!t) {
-               ERR("t is NULL");
+               _E("t is NULL");
                return 0;
        }
 
index f29a668..598f172 100644 (file)
@@ -45,21 +45,21 @@ sensor_event_dispatcher& sensor_event_dispatcher::get_instance()
 
 bool sensor_event_dispatcher::run(void)
 {
-       INFO("Starting Event Dispatcher\n");
+       _I("Starting Event Dispatcher\n");
 
        if (!m_accept_socket.create(SOCK_SEQPACKET)) {
-               ERR("Listener Socket Creation failed in Server \n");
+               _E("Listener Socket Creation failed in Server \n");
                return false;
        }
 
        if(!m_accept_socket.bind(EVENT_CHANNEL_PATH)) {
-               ERR("Listener Socket Binding failed in Server \n");
+               _E("Listener Socket Binding failed in Server \n");
                m_accept_socket.close();
                return false;
        }
 
        if(!m_accept_socket.listen(MAX_PENDING_CONNECTION)) {
-               ERR("Socket Listen failed in Server \n");
+               _E("Socket Listen failed in Server \n");
                return false;
        }
 
@@ -81,7 +81,7 @@ void sensor_event_dispatcher::accept_event_channel(csocket client_socket)
        client_socket.set_connection_mode();
 
        if (client_socket.recv(&client_id, sizeof(client_id)) <= 0) {
-               ERR("Failed to receive client id on socket fd[%d]", client_socket.get_socket_fd());
+               _E("Failed to receive client id on socket fd[%d]", client_socket.get_socket_fd());
                return;
        }
 
@@ -90,7 +90,7 @@ void sensor_event_dispatcher::accept_event_channel(csocket client_socket)
        AUTOLOCK(m_mutex);
 
        if(!get_client_info_manager().set_event_socket(client_id, client_socket)) {
-               ERR("Failed to store event socket[%d] for %s", client_socket.get_socket_fd(),
+               _E("Failed to store event socket[%d] for %s", client_socket.get_socket_fd(),
                        client_info_manager.get_client_info(client_id));
                return;
        }
@@ -98,11 +98,11 @@ void sensor_event_dispatcher::accept_event_channel(csocket client_socket)
        event_channel_ready.magic = EVENT_CHANNEL_MAGIC;
        event_channel_ready.client_id = client_id;
 
-       INFO("Event channel is accepted for %s on socket[%d]",
+       _I("Event channel is accepted for %s on socket[%d]",
                client_info_manager.get_client_info(client_id), client_socket.get_socket_fd());
 
        if (client_socket.send(&event_channel_ready, sizeof(event_channel_ready)) <= 0) {
-               ERR("Failed to send event_channel_ready packet to %s on socket fd[%d]",
+               _E("Failed to send event_channel_ready packet to %s on socket fd[%d]",
                        client_info_manager.get_client_info(client_id), client_socket.get_socket_fd());
                return;
        }
@@ -110,17 +110,17 @@ void sensor_event_dispatcher::accept_event_channel(csocket client_socket)
 
 void sensor_event_dispatcher::accept_connections(void)
 {
-       INFO("Event channel acceptor is started.\n");
+       _I("Event channel acceptor is started.\n");
 
        while (true) {
                csocket client_socket;
 
                if (!m_accept_socket.accept(client_socket)) {
-                       ERR("Accepting socket failed in Server \n");
+                       _E("Accepting socket failed in Server \n");
                        continue;
                }
 
-               INFO("New client connected (socket_fd : %d)\n", client_socket.get_socket_fd());
+               _I("New client connected (socket_fd : %d)\n", client_socket.get_socket_fd());
 
                thread event_channel_creator(&sensor_event_dispatcher::accept_event_channel, this, client_socket);
                event_channel_creator.detach();
@@ -133,7 +133,7 @@ void sensor_event_dispatcher::dispatch_event(void)
 
        vector<sensor_event_t> v_sensor_events(MAX_SYNTH_PER_SENSOR);
 
-       INFO("Event Dispatcher started");
+       _I("Event Dispatcher started");
 
        while (true) {
                void *seed_event = get_event_queue().pop();
@@ -154,7 +154,7 @@ void sensor_event_dispatcher::dispatch_event(void)
                        for (int i = 0; i < synthesized_cnt; ++i) {
                                sensor_event_t *v_event = (sensor_event_t*)malloc(sizeof(sensor_event_t));
                                if (!v_event) {
-                                       ERR("Failed to allocate memory");
+                                       _E("Failed to allocate memory");
                                        continue;
                                }
 
@@ -198,7 +198,7 @@ void sensor_event_dispatcher::send_sensor_events(vector<void *> &events)
 
                event = (void *)malloc(length);
                if (!event) {
-                       ERR("Failed to allocate memory");
+                       _E("Failed to allocate memory");
                        return;
                }
 
@@ -216,9 +216,9 @@ void sensor_event_dispatcher::send_sensor_events(vector<void *> &events)
                        bool ret = (client_socket.send(event, length) > 0);
 
                        if (ret)
-                               DBG("Event[0x%x] sent to %s on socket[%d]", event_type, client_info_manager.get_client_info(*it_client_id), client_socket.get_socket_fd());
+                               _D("Event[0x%x] sent to %s on socket[%d]", event_type, client_info_manager.get_client_info(*it_client_id), client_socket.get_socket_fd());
                        else
-                               ERR("Failed to send event[0x%x] to %s on socket[%d]", event_type, client_info_manager.get_client_info(*it_client_id), client_socket.get_socket_fd());
+                               _E("Failed to send event[0x%x] to %s on socket[%d]", event_type, client_info_manager.get_client_info(*it_client_id), client_socket.get_socket_fd());
 
                        ++it_client_id;
                }
@@ -298,7 +298,7 @@ void sensor_event_dispatcher::request_last_event(int client_id, sensor_id_t sens
 
        if (client_info_manager.get_registered_events(client_id, sensor_id, event_vec)) {
                if (!client_info_manager.get_event_socket(client_id, client_socket)) {
-                       ERR("Failed to get event socket from %s",
+                       _E("Failed to get event socket from %s",
                                        client_info_manager.get_client_info(client_id));
                        return;
                }
@@ -308,10 +308,10 @@ void sensor_event_dispatcher::request_last_event(int client_id, sensor_id_t sens
                        sensor_event_t event;
                        if (is_record_event(*it_event) && get_last_event(*it_event, event)) {
                                if (client_socket.send(&event, sizeof(event)) > 0)
-                                       INFO("Send the last event[0x%x] to %s on socket[%d]", event.event_type,
+                                       _I("Send the last event[0x%x] to %s on socket[%d]", event.event_type,
                                                client_info_manager.get_client_info(client_id), client_socket.get_socket_fd());
                                else
-                                       ERR("Failed to send event[0x%x] to %s on socket[%d]", event.event_type,
+                                       _E("Failed to send event[0x%x] to %s on socket[%d]", event.event_type,
                                                client_info_manager.get_client_info(client_id), client_socket.get_socket_fd());
                        }
                        ++it_event;
@@ -325,7 +325,7 @@ bool sensor_event_dispatcher::add_active_virtual_sensor(virtual_sensor * sensor)
        AUTOLOCK(m_active_virtual_sensors_mutex);
 
        if (has_active_virtual_sensor(sensor)) {
-               ERR("[%s] sensor is already added on active virtual sensors", sensor->get_name());
+               _E("[%s] sensor is already added on active virtual sensors", sensor->get_name());
                return false;
        }
 
@@ -341,7 +341,7 @@ bool sensor_event_dispatcher::delete_active_virtual_sensor(virtual_sensor * sens
        auto it_v_sensor = find(m_active_virtual_sensors.begin(), m_active_virtual_sensors.end(), sensor);
 
        if (it_v_sensor == m_active_virtual_sensors.end()) {
-               ERR("Fail to delete non-existent [%s] sensor on active virtual sensors", sensor->get_name());
+               _E("Fail to delete non-existent [%s] sensor on active virtual sensors", sensor->get_name());
                return false;
        }
 
index 0070db3..62b26b9 100644 (file)
@@ -105,7 +105,7 @@ bool sensor_event_poller::read_fd(int fd, std::vector<uint32_t> &ids)
        sensor = dynamic_cast<physical_sensor *>(it->second);
 
        if (!sensor) {
-               ERR("Failed to get sensor");
+               _E("Failed to get sensor");
                return false;
        }
 
index 79b8baf..c26e83e 100644 (file)
@@ -32,7 +32,7 @@ void sensor_event_queue::push_internal(void *event)
        bool wake = m_queue.empty();
 
        if (m_queue.size() >= QUEUE_FULL_SIZE) {
-               ERR("Queue is full, drop it!");
+               _E("Queue is full, drop it!");
                free(event);
        } else
                m_queue.push(event);
index 43d0395..7a90ffb 100644 (file)
@@ -55,12 +55,12 @@ bool sensor_loader::load_devices(const string &path, vector<sensor_device_t> &de
        int size;
        sensor_device_t *_devices = NULL;
 
-       INFO("load device: [%s]", path.c_str());
+       _I("load device: [%s]", path.c_str());
 
        void *_handle = dlopen(path.c_str(), RTLD_NOW);
 
        if (!_handle) {
-               ERR("Failed to dlopen(%s), dlerror : %s", path.c_str(), dlerror());
+               _E("Failed to dlopen(%s), dlerror : %s", path.c_str(), dlerror());
                return false;
        }
 
@@ -69,7 +69,7 @@ bool sensor_loader::load_devices(const string &path, vector<sensor_device_t> &de
        create_t create_devices = (create_t) dlsym(_handle, "create");
 
        if (!create_devices) {
-               ERR("Failed to find symbols in %s", path.c_str());
+               _E("Failed to find symbols in %s", path.c_str());
                dlclose(_handle);
                return false;
        }
@@ -77,7 +77,7 @@ bool sensor_loader::load_devices(const string &path, vector<sensor_device_t> &de
        size = create_devices(&_devices);
 
        if (!_devices) {
-               ERR("Failed to create devices, path is %s\n", path.c_str());
+               _E("Failed to create devices, path is %s\n", path.c_str());
                dlclose(_handle);
                return false;
        }
@@ -103,7 +103,7 @@ physical_sensor* sensor_loader::create_sensor(sensor_handle_t handle, sensor_dev
 
        sensor = new(std::nothrow) physical_sensor();
        if (!sensor) {
-               ERR("Memory allocation failed[%s]", handle.name);
+               _E("Memory allocation failed[%s]", handle.name);
                return NULL;
        }
 
@@ -134,7 +134,7 @@ bool sensor_loader::load_physical_sensors(std::vector<sensor_device_t> &devices)
                        std::shared_ptr<sensor_base> sensor_ptr(sensor);
                        m_sensors.insert(std::make_pair((sensor_type_t)(handles[i].type), sensor_ptr));
 
-                       INFO("inserted [%s] sensor", sensor->get_name());
+                       _I("inserted [%s] sensor", sensor->get_name());
                }
        }
 
@@ -186,15 +186,15 @@ void sensor_loader::load_virtual_sensor(const char *name)
        try {
                instance = new _sensor;
        } catch (std::exception &e) {
-               ERR("Failed to create %s sensor, exception: %s", name, e.what());
+               _E("Failed to create %s sensor, exception: %s", name, e.what());
                return;
        } catch (int err) {
-               ERR("Failed to create %s sensor err: %d, cause: %s", name, err, strerror(err));
+               _E("Failed to create %s sensor err: %d, cause: %s", name, err, strerror(err));
                return;
        }
 
        if (!instance->init()) {
-               ERR("Failed to init %s", name);
+               _E("Failed to init %s", name);
                delete instance;
                return;
        }
@@ -216,7 +216,7 @@ void sensor_loader::load_virtual_sensors(void)
 
 void sensor_loader::show_sensor_info(void)
 {
-       INFO("========== Loaded sensor information ==========\n");
+       _I("========== Loaded sensor information ==========\n");
 
        int index = 0;
 
@@ -227,12 +227,12 @@ void sensor_loader::show_sensor_info(void)
 
                sensor_info info;
                sensor->get_sensor_info(info);
-               INFO("No:%d [%s]\n", ++index, sensor->get_name());
+               _I("No:%d [%s]\n", ++index, sensor->get_name());
                info.show();
                it++;
        }
 
-       INFO("===============================================\n");
+       _I("===============================================\n");
 }
 
 bool sensor_loader::get_paths_from_dir(const string &dir_path, vector<string> &plugin_paths)
@@ -243,7 +243,7 @@ bool sensor_loader::get_paths_from_dir(const string &dir_path, vector<string> &p
        dir = opendir(dir_path.c_str());
 
        if (!dir) {
-               ERR("Failed to open dir: %s", dir_path.c_str());
+               _E("Failed to open dir: %s", dir_path.c_str());
                return false;
        }
 
index cc114ff..6f604fa 100644 (file)
@@ -40,7 +40,7 @@ bool sensor_usage::register_event(unsigned int event_type)
        auto it_event = find(m_reg_events.begin(), m_reg_events.end(), event_type);
 
        if (it_event != m_reg_events.end()) {
-               ERR("Event[0x%x] is already registered", event_type);
+               _E("Event[0x%x] is already registered", event_type);
                return false;
        }
 
@@ -53,7 +53,7 @@ bool sensor_usage::unregister_event(unsigned int event_type)
        auto it_event = find(m_reg_events.begin(), m_reg_events.end(), event_type);
 
        if (it_event == m_reg_events.end()) {
-               ERR("Event[0x%x] is not found",event_type);
+               _E("Event[0x%x] is not found",event_type);
                return false;
        }
 
@@ -67,7 +67,7 @@ bool sensor_usage::is_event_registered(unsigned int event_type)
        auto it_event = find (m_reg_events.begin(), m_reg_events.end(), event_type);
 
        if (it_event == m_reg_events.end()){
-               DBG("Event[0x%x] is not registered",event_type);
+               _D("Event[0x%x] is not registered",event_type);
                return false;
        }
 
index ad28539..39900bc 100644 (file)
@@ -61,22 +61,22 @@ void server::accept_client(void)
 {
        command_worker *cmd_worker;
 
-       INFO("Client acceptor is started");
+       _I("Client acceptor is started");
 
        while (true) {
                csocket client_command_socket;
 
                if (!m_client_accep_socket.accept(client_command_socket)) {
-                       ERR("Failed to accept connection request from a client");
+                       _E("Failed to accept connection request from a client");
                        continue;
                }
 
-               DBG("New client (socket_fd : %d) connected", client_command_socket.get_socket_fd());
+               _D("New client (socket_fd : %d) connected", client_command_socket.get_socket_fd());
 
                cmd_worker = new(std::nothrow) command_worker(client_command_socket);
 
                if (!cmd_worker) {
-                       ERR("Failed to allocate memory");
+                       _E("Failed to allocate memory");
                        continue;
                }
 
@@ -87,12 +87,12 @@ void server::accept_client(void)
 
 void server::poll_event(void)
 {
-       INFO("Event poller is started");
+       _I("Event poller is started");
 
        sensor_event_poller poller;
 
        if (!poller.poll()) {
-               ERR("Failed to poll event");
+               _E("Failed to poll event");
                return;
        }
 }
@@ -107,23 +107,23 @@ void server::run(void)
        sock_fd = get_systemd_socket(COMMAND_CHANNEL_PATH);
 
        if (sock_fd >= 0) {
-               INFO("Succeeded to get systemd socket(%d)", sock_fd);
+               _I("Succeeded to get systemd socket(%d)", sock_fd);
                m_client_accep_socket = csocket(sock_fd);
        } else {
-               ERR("Failed to get systemd socket, create it by myself!");
+               _E("Failed to get systemd socket, create it by myself!");
                if (!m_client_accep_socket.create(SOCK_STREAM)) {
-                       ERR("Failed to create command channel");
+                       _E("Failed to create command channel");
                        return;
                }
 
                if(!m_client_accep_socket.bind(COMMAND_CHANNEL_PATH)) {
-                       ERR("Failed to bind command channel");
+                       _E("Failed to bind command channel");
                        m_client_accep_socket.close();
                        return;
                }
 
                if(!m_client_accep_socket.listen(MAX_PENDING_CONNECTION)) {
-                       ERR("Failed to listen command channel");
+                       _E("Failed to listen command channel");
                        return;
                }
        }
index 1741239..ae23c1c 100644 (file)
@@ -50,9 +50,9 @@ virtual_sensor_config& virtual_sensor_config::get_instance(void)
                inst.load_config(VIRTUAL_SENSOR_CONFIG_FILE_PATH);
                inst.get_device_id();
                if (!inst.m_device_id.empty())
-                       INFO("Device ID = %s", inst.m_device_id.c_str());
+                       _I("Device ID = %s", inst.m_device_id.c_str());
                else
-                       ERR("Failed to get Device ID");
+                       _E("Failed to get Device ID");
                load_done = true;
        }
 
@@ -64,24 +64,24 @@ bool virtual_sensor_config::load_config(const string& config_path)
        xmlDocPtr doc;
        xmlNodePtr cur;
 
-       DBG("virtual_sensor_config::load_config(\"%s\") is called!\n",config_path.c_str());
+       _D("virtual_sensor_config::load_config(\"%s\") is called!\n",config_path.c_str());
 
        doc = xmlParseFile(config_path.c_str());
 
        if (doc == NULL) {
-               ERR("There is no %s\n",config_path.c_str());
+               _E("There is no %s\n",config_path.c_str());
                return false;
        }
 
        cur = xmlDocGetRootElement(doc);
        if(cur == NULL) {
-               ERR("There is no root element in %s\n",config_path.c_str());
+               _E("There is no root element in %s\n",config_path.c_str());
                xmlFreeDoc(doc);
                return false;
        }
 
        if(xmlStrcmp(cur->name, (const xmlChar *)ROOT_ELEMENT)) {
-               ERR("Wrong type document: there is no [%s] root element in %s\n",ROOT_ELEMENT,config_path.c_str());
+               _E("Wrong type document: there is no [%s] root element in %s\n",ROOT_ELEMENT,config_path.c_str());
                xmlFreeDoc(doc);
                return false;
        }
@@ -108,7 +108,7 @@ bool virtual_sensor_config::load_config(const string& config_path)
 
                //insert device to device_list
                m_virtual_sensor_configs[device_type];
-               DBG("<type=\"%s\">\n",device_type.c_str());
+               _D("<type=\"%s\">\n",device_type.c_str());
 
                virtual_sensor_node_ptr = device_node_ptr->xmlChildrenNode;
 
@@ -120,7 +120,7 @@ bool virtual_sensor_config::load_config(const string& config_path)
                        }
 
                        m_virtual_sensor_configs[device_type][(const char*)virtual_sensor_node_ptr->name];
-                       DBG("<type=\"%s\"><%s>\n",device_type.c_str(),(const char*)virtual_sensor_node_ptr->name);
+                       _D("<type=\"%s\"><%s>\n",device_type.c_str(),(const char*)virtual_sensor_node_ptr->name);
 
                        element_node_ptr = virtual_sensor_node_ptr->xmlChildrenNode;
                        while (element_node_ptr != NULL) {
@@ -132,7 +132,7 @@ bool virtual_sensor_config::load_config(const string& config_path)
 
                                //insert Element to Model
                                m_virtual_sensor_configs[device_type][(const char*)virtual_sensor_node_ptr->name][(const char*)element_node_ptr->name];
-                               DBG("<type=\"%s\"><%s><%s>\n",device_type.c_str(),(const char*)virtual_sensor_node_ptr->name,(const char*)element_node_ptr->name);
+                               _D("<type=\"%s\"><%s><%s>\n",device_type.c_str(),(const char*)virtual_sensor_node_ptr->name,(const char*)element_node_ptr->name);
 
                                attr_ptr = element_node_ptr->properties;
                                while (attr_ptr != NULL) {
@@ -145,14 +145,14 @@ bool virtual_sensor_config::load_config(const string& config_path)
 
                                        //insert attribute to Element
                                        m_virtual_sensor_configs[device_type][(const char*)virtual_sensor_node_ptr->name][(const char*)element_node_ptr->name][key]=value;
-                                       DBG("<type=\"%s\"><%s><%s \"%s\"=\"%s\">\n",device_type.c_str(),(const char*)virtual_sensor_node_ptr->name,(const char*)element_node_ptr->name,key.c_str(),value.c_str());
+                                       _D("<type=\"%s\"><%s><%s \"%s\"=\"%s\">\n",device_type.c_str(),(const char*)virtual_sensor_node_ptr->name,(const char*)element_node_ptr->name,key.c_str(),value.c_str());
                                        attr_ptr = attr_ptr->next;
                                }
 
                                element_node_ptr = element_node_ptr->next;
                        }
 
-                       DBG("\n");
+                       _D("\n");
                        virtual_sensor_node_ptr = virtual_sensor_node_ptr->next;
                }
 
@@ -168,37 +168,37 @@ bool virtual_sensor_config::get(const string& sensor_type, const string& element
        auto it_device_list = m_virtual_sensor_configs.find(m_device_id);
 
        if (it_device_list == m_virtual_sensor_configs.end())   {
-               ERR("There is no <%s> device\n",m_device_id.c_str());
+               _E("There is no <%s> device\n",m_device_id.c_str());
 
                m_device_id = DEFAULT_DEVICE;
                it_device_list = m_virtual_sensor_configs.find(m_device_id);
 
                if (it_device_list == m_virtual_sensor_configs.end()) {
-                       ERR("There is no Default device\n");
+                       _E("There is no Default device\n");
                        return false;
                }
 
-               INFO("m_device_id is set to Default\n");
+               _I("m_device_id is set to Default\n");
        }
 
        auto it_virtual_sensor_list = it_device_list->second.find(sensor_type);
 
        if (it_virtual_sensor_list == it_device_list->second.end())     {
-               ERR("There is no <%s> sensor\n",sensor_type.c_str());
+               _E("There is no <%s> sensor\n",sensor_type.c_str());
                return false;
        }
 
        auto it_element = it_virtual_sensor_list->second.find(element);
 
        if (it_element == it_virtual_sensor_list->second.end()) {
-               ERR("There is no <%s><%s> element\n",sensor_type.c_str(),element.c_str());
+               _E("There is no <%s><%s> element\n",sensor_type.c_str(),element.c_str());
                return false;
        }
 
        auto it_attr = it_element->second.find(attr);
 
        if (it_attr == it_element->second.end()) {
-               DBG("There is no <%s><%s \"%s\">\n",sensor_type.c_str(),element.c_str(),attr.c_str());
+               _D("There is no <%s><%s \"%s\">\n",sensor_type.c_str(),element.c_str(),attr.c_str());
                return false;
        }
 
@@ -269,7 +269,7 @@ bool virtual_sensor_config::get(const string& sensor_type, const string& element
        }
        else
        {
-               DBG("Count value not supported.\n");
+               _D("Count value not supported.\n");
        }
 
        return false;
@@ -301,7 +301,7 @@ bool virtual_sensor_config::get(const string& sensor_type, const string& element
        }
        else
        {
-               DBG("Count value not supported.\n");
+               _D("Count value not supported.\n");
        }
 
        return false;
index e6e7d4a..2590588 100644 (file)
@@ -41,7 +41,7 @@ bool worker_thread::transition_function(trans_func_index index)
 {
        if (m_trans_func[index] != NULL) {
                if(!m_trans_func[index](m_context)) {
-                       ERR("Transition[%d] function returning false", index);
+                       _E("Transition[%d] function returning false", index);
                        return false;
                }
        }
@@ -61,7 +61,7 @@ bool worker_thread::start(void)
        lock l(m_mutex);
 
        if (m_state == WORKER_STATE_WORKING) {
-               INFO("Worker thread is already working");
+               _I("Worker thread is already working");
                return true;
        }
 
@@ -79,7 +79,7 @@ bool worker_thread::start(void)
                return true;
        }
 
-       ERR("Failed to start, because current state(%d) is not for START", m_state);
+       _E("Failed to start, because current state(%d) is not for START", m_state);
 
        return false;
 }
@@ -89,7 +89,7 @@ bool worker_thread::stop(void)
        lock l(m_mutex);
 
        if (m_state == WORKER_STATE_STOPPED) {
-               INFO("Worker thread is already stopped");
+               _I("Worker thread is already stopped");
                return true;
        }
 
@@ -102,7 +102,7 @@ bool worker_thread::stop(void)
                return true;
        }
 
-       ERR("Failed to stop, because current state(%d) is not for STOP", m_state);
+       _E("Failed to stop, because current state(%d) is not for STOP", m_state);
        return false;
 }
 
@@ -111,7 +111,7 @@ bool worker_thread::pause(void)
        lock l(m_mutex);
 
        if (m_state == WORKER_STATE_PAUSED) {
-               INFO("Worker thread is already paused");
+               _I("Worker thread is already paused");
                return true;
        }
 
@@ -120,7 +120,7 @@ bool worker_thread::pause(void)
                return true;
        }
 
-       ERR("Failed to pause, because current state(%d) is not for PAUSE", m_state);
+       _E("Failed to pause, because current state(%d) is not for PAUSE", m_state);
 
        return false;
 
@@ -131,7 +131,7 @@ bool worker_thread::resume(void)
        lock l(m_mutex);
 
        if (m_state == WORKER_STATE_WORKING) {
-               INFO("Worker thread is already working");
+               _I("Worker thread is already working");
                return true;
        }
 
@@ -141,7 +141,7 @@ bool worker_thread::resume(void)
                return true;
        }
 
-       ERR("Failed to resume, because current state(%d) is not for RESUME", m_state);
+       _E("Failed to resume, because current state(%d) is not for RESUME", m_state);
        return false;
 }
 
@@ -153,7 +153,7 @@ bool worker_thread::resume(void)
 
 void worker_thread::main(void)
 {
-       DBG("Worker thread(0x%x) is created", std::this_thread::get_id());
+       _D("Worker thread(0x%x) is created", std::this_thread::get_id());
 
        transition_function(STARTED);
 
@@ -164,7 +164,7 @@ void worker_thread::main(void)
                if (state == WORKER_STATE_WORKING) {
                        if (!transition_function(WORKING)) {
                                m_state = WORKER_STATE_STOPPED;
-                               DBG("Worker thread(0x%x) exits from working state", std::this_thread::get_id());
+                               _D("Worker thread(0x%x) exits from working state", std::this_thread::get_id());
                                m_thread_created = false;
                                transition_function(STOPPED);
                                break;
@@ -177,12 +177,12 @@ void worker_thread::main(void)
                if (m_state == WORKER_STATE_PAUSED) {
                        transition_function(PAUSED);
 
-                       DBG("Worker thread(0x%x) is paused", std::this_thread::get_id());
+                       _D("Worker thread(0x%x) is paused", std::this_thread::get_id());
                        m_cond_working.wait(u);
 
                        if (m_state == WORKER_STATE_WORKING) {
                                transition_function(RESUMED);
-                               DBG("Worker thread(0x%x) is resumed", std::this_thread::get_id());
+                               _D("Worker thread(0x%x) is resumed", std::this_thread::get_id());
                        } else if (m_state == WORKER_STATE_STOPPED) {
                                m_thread_created = false;
                                transition_function(STOPPED);
@@ -194,7 +194,7 @@ void worker_thread::main(void)
                        break;
                }
        }
-       INFO("Worker thread(0x%x)'s main is terminated", std::this_thread::get_id());
+       _I("Worker thread(0x%x)'s main is terminated", std::this_thread::get_id());
 }
 
 void worker_thread::set_started(trans_func_t func)
index 2b085e3..bc85c19 100644 (file)
@@ -64,7 +64,7 @@ void cbase_lock::lock(lock_type type, const char* expr, const char *module, cons
        lock_waiting_start_time = MICROSECONDS(sv);
 
        pthread_mutex_lock(&m_history_mutex);
-       INFO("%s is waiting for getting %s(0x%x) owned in %s",
+       _I("%s is waiting for getting %s(0x%x) owned in %s",
                m_curent_info, expr, this, m_owner_info);
        pthread_mutex_unlock(&m_history_mutex);
 
@@ -82,7 +82,7 @@ void cbase_lock::lock(lock_type type, const char* expr, const char *module, cons
        waiting_time = lock_acquired_time - lock_waiting_start_time;
 
        pthread_mutex_lock(&m_history_mutex);
-       INFO("%s acquires lock after waiting %lluus, %s(0x%x) was previously owned in %s",
+       _I("%s acquires lock after waiting %lluus, %s(0x%x) was previously owned in %s",
                m_curent_info, waiting_time, expr, this, m_owner_info);
        snprintf(m_owner_info, OWNER_INFO_LEN, "%s", m_curent_info);
        pthread_mutex_unlock(&m_history_mutex);
index 5fbb2c1..a58b22a 100644 (file)
@@ -68,7 +68,7 @@ bool csocket::create(int sock_type)
        m_sock_fd = socket(AF_UNIX, sock_type, 0);
 
        if (!is_valid()) {
-               ERR("Failed to create socket for %s, errno : %d , errstr : %s ",
+               _E("Failed to create socket for %s, errno : %d , errstr : %s ",
                        get_client_name(), errno, strerror(errno));
                return false;
        }
@@ -84,14 +84,14 @@ bool csocket::bind (const char *sock_path)
        mode_t socket_mode;
 
        if (!is_valid()) {
-               ERR("%s's socket is invalid", get_client_name());
+               _E("%s's socket is invalid", get_client_name());
                return false;
        }
 
        if((fsetxattr(m_sock_fd, "security.SMACK64IPOUT", "@", 2, 0)) < 0) {
                if(errno != EOPNOTSUPP) {
                        close();
-                       ERR("security.SMACK64IPOUT error = [%d][%s]\n", errno, strerror(errno) );
+                       _E("security.SMACK64IPOUT error = [%d][%s]\n", errno, strerror(errno) );
                        return false;
                }
        }
@@ -99,7 +99,7 @@ bool csocket::bind (const char *sock_path)
        if((fsetxattr(m_sock_fd, "security.SMACK64IPIN", "*", 2, 0)) < 0) {
                if(errno != EOPNOTSUPP) {
                        close();
-                       ERR("security.SMACK64IPIN error  = [%d][%s]\n", errno, strerror(errno) );
+                       _E("security.SMACK64IPIN error  = [%d][%s]\n", errno, strerror(errno) );
                        return false;
                }
        }
@@ -116,14 +116,14 @@ bool csocket::bind (const char *sock_path)
        length = strlen(m_addr.sun_path) + sizeof(m_addr.sun_family);
 
        if (::bind(m_sock_fd, (struct sockaddr *)&m_addr, length) < 0) {
-               ERR("Binding failed for socket(%d), errno : %d , errstr : %s", m_sock_fd, errno, strerror(errno));
+               _E("Binding failed for socket(%d), errno : %d , errstr : %s", m_sock_fd, errno, strerror(errno));
                close();
                return false;
        }
 
        socket_mode = ( S_IRWXU | S_IRWXG | S_IRWXO );
        if (chmod(sock_path, socket_mode) < 0) {
-               ERR("chmod failed for socket(%d), errno : %d , errstr : %s", m_sock_fd, errno, strerror(errno));
+               _E("chmod failed for socket(%d), errno : %d , errstr : %s", m_sock_fd, errno, strerror(errno));
                close();
                return false;
        }
@@ -134,12 +134,12 @@ bool csocket::bind (const char *sock_path)
 bool csocket::listen(const int max_connections)
 {
        if (!is_valid()) {
-               ERR("Socket(%d) is invalid", m_sock_fd);
+               _E("Socket(%d) is invalid", m_sock_fd);
                return false;
        }
 
        if (::listen(m_sock_fd, max_connections) < 0) {
-               ERR("Listening failed for socket(%d), errno : %d , errstr : %s", m_sock_fd, errno, strerror(errno));
+               _E("Listening failed for socket(%d), errno : %d , errstr : %s", m_sock_fd, errno, strerror(errno));
                close();
                return false;
        }
@@ -161,7 +161,7 @@ bool csocket::accept(csocket& client_socket) const
        } while (err == EINTR);
 
        if (!client_socket.is_valid()) {
-               ERR("Accept failed for socket(%d), errno : %d , errstr : %s", m_sock_fd, errno, strerror(errno));
+               _E("Accept failed for socket(%d), errno : %d , errstr : %s", m_sock_fd, errno, strerror(errno));
                return false;
        }
 
@@ -178,7 +178,7 @@ ssize_t csocket::send_for_seqpacket(const void *buffer, size_t size) const
        } while (err == EINTR);
 
        if (err) {
-               ERR("send(%d, 0x%x, %d, 0x%x) = %d cause = %s(%d)",
+               _E("send(%d, 0x%x, %d, 0x%x) = %d cause = %s(%d)",
                        m_sock_fd, buffer, size, m_send_flags, len, strerror(errno), errno);
        }
 
@@ -195,7 +195,7 @@ ssize_t csocket::recv_for_seqpacket(void* buffer, size_t size) const
                if (len > 0) {
                        err = 0;
                } else if (len == 0) {
-                       ERR("recv(%d, 0x%p , %d) = %d, because the peer performed shutdown!",
+                       _E("recv(%d, 0x%p , %d) = %d, because the peer performed shutdown!",
                                m_sock_fd, buffer, size, len);
                        err = 1;
                } else {
@@ -204,13 +204,13 @@ ssize_t csocket::recv_for_seqpacket(void* buffer, size_t size) const
     } while (err == EINTR);
 
        if ((err == EAGAIN) || (err == EWOULDBLOCK)) {
-               DBG("recv(%d, 0x%x, %d, 0x%x) = %d cause = %s(%d)",
+               _D("recv(%d, 0x%x, %d, 0x%x) = %d cause = %s(%d)",
                        m_sock_fd, buffer, size, m_recv_flags, len, strerror(errno), errno);
                return 0;
        }
 
        if (err) {
-               ERR("recv(%d, 0x%x, %d, 0x%x) = %d cause = %s(%d)",
+               _E("recv(%d, 0x%x, %d, 0x%x) = %d cause = %s(%d)",
                        m_sock_fd, buffer, size, m_recv_flags, len, strerror(errno), errno);
        }
 
@@ -231,7 +231,7 @@ ssize_t csocket::send_for_stream(const void *buffer, size_t size) const
                        total_sent_size += len;
                        err = 0;
                } else {
-                       ERR("send(%d, 0x%p + %d, %d - %d) = %d, error: %s(%d) for %s",
+                       _E("send(%d, 0x%p + %d, %d - %d) = %d, error: %s(%d) for %s",
                                m_sock_fd, buffer, total_sent_size, size, total_sent_size,
                                len, strerror(errno), errno, get_client_name());
 
@@ -257,12 +257,12 @@ ssize_t csocket::recv_for_stream(void* buffer, size_t size) const
                if (len > 0) {
                        total_recv_size += len;
                } else if (len == 0) {
-                       ERR("recv(%d, 0x%p + %d, %d - %d) = %d, because the peer of %s performed shutdown!",
+                       _E("recv(%d, 0x%p + %d, %d - %d) = %d, because the peer of %s performed shutdown!",
                                m_sock_fd, buffer, total_recv_size, size, total_recv_size, len, get_client_name());
                        err = 1;
                        break;
                } else {
-                       ERR("recv(%d, 0x%p + %d, %d - %d) = %d, error: %s(%d) for %s",
+                       _E("recv(%d, 0x%p + %d, %d - %d) = %d, error: %s(%d) for %s",
                                m_sock_fd, buffer, total_recv_size, size, total_recv_size,
                                len, strerror(errno), errno, get_client_name());
 
@@ -302,7 +302,7 @@ bool csocket::connect(const char *sock_path)
        bool prev_blocking_mode;
 
        if (!is_valid()) {
-               ERR("%s's socket is invalid", get_client_name());
+               _E("%s's socket is invalid", get_client_name());
                return false;
        }
 
@@ -318,7 +318,7 @@ bool csocket::connect(const char *sock_path)
        addr_len = strlen(m_addr.sun_path) + sizeof(m_addr.sun_family);
 
        if (::connect(m_sock_fd,(sockaddr *) &m_addr, addr_len) < 0) {
-               ERR("connect error: %s sock_fd: %d\n for %s", strerror(errno), m_sock_fd, get_client_name());
+               _E("connect error: %s sock_fd: %d\n for %s", strerror(errno), m_sock_fd, get_client_name());
                return false;
        }
 
@@ -332,17 +332,17 @@ bool csocket::connect(const char *sock_path)
        ret = select(m_sock_fd + 1, NULL, &write_fds, NULL, &tv);
 
        if (ret == -1) {
-               ERR("select error: %s sock_fd: %d\n for %s", strerror(errno), m_sock_fd, get_client_name());
+               _E("select error: %s sock_fd: %d\n for %s", strerror(errno), m_sock_fd, get_client_name());
                close();
                return false;
        } else if (!ret) {
-               ERR("select timeout: %d seconds elapsed for %s", tv.tv_sec, get_client_name());
+               _E("select timeout: %d seconds elapsed for %s", tv.tv_sec, get_client_name());
                close();
                return false;
        }
 
        if (!FD_ISSET(m_sock_fd, &write_fds)) {
-               ERR("select failed for %s, nothing to write, m_sock_fd : %d", get_client_name(), m_sock_fd);
+               _E("select failed for %s, nothing to write, m_sock_fd : %d", get_client_name(), m_sock_fd);
                close();
                return false;
        }
@@ -351,14 +351,14 @@ bool csocket::connect(const char *sock_path)
        socklen_t len = sizeof(so_error);
 
        if (getsockopt(m_sock_fd, SOL_SOCKET, SO_ERROR, &so_error, &len) == -1) {
-               ERR("getsockopt failed for %s, m_sock_fd : %d, errno : %d , errstr : %s",
+               _E("getsockopt failed for %s, m_sock_fd : %d, errno : %d , errstr : %s",
                        get_client_name(), m_sock_fd, errno, strerror(errno));
                close();
                return false;
        }
 
        if (so_error) {
-               ERR("SO_ERROR occurred for %s, m_sock_fd : %d, so_error : %d",
+               _E("SO_ERROR occurred for %s, m_sock_fd : %d, so_error : %d",
                        get_client_name(), m_sock_fd, so_error);
                close();
                return false;
@@ -377,7 +377,7 @@ bool csocket::set_blocking_mode(bool blocking)
        flags = fcntl(m_sock_fd, F_GETFL);
 
        if (flags == -1) {
-               ERR("fcntl(F_GETFL) failed for %s, m_sock_fd: %d, errno : %d , errstr : %s", get_client_name(), m_sock_fd, errno, strerror(errno));
+               _E("fcntl(F_GETFL) failed for %s, m_sock_fd: %d, errno : %d , errstr : %s", get_client_name(), m_sock_fd, errno, strerror(errno));
                return false;
        }
 
@@ -386,7 +386,7 @@ bool csocket::set_blocking_mode(bool blocking)
        flags = fcntl(m_sock_fd, F_SETFL, flags);
 
        if (flags == -1) {
-               ERR("fcntl(F_SETFL) failed for %s, m_sock_fd: %d, errno : %d , errstr : %s", get_client_name(), m_sock_fd, errno, strerror(errno));
+               _E("fcntl(F_SETFL) failed for %s, m_sock_fd: %d, errno : %d , errstr : %s", get_client_name(), m_sock_fd, errno, strerror(errno));
                return false;
        }
 
@@ -402,7 +402,7 @@ bool csocket::set_sock_type(void)
        opt_len = sizeof(sock_type);
 
        if (getsockopt(m_sock_fd, SOL_SOCKET, SO_TYPE, &sock_type, &opt_len) < 0) {
-          ERR("getsockopt(SOL_SOCKET, SO_TYPE) failed for %s, m_sock_fd: %d, errno : %d , errstr : %s", get_client_name(), m_sock_fd, errno, strerror(errno));
+          _E("getsockopt(SOL_SOCKET, SO_TYPE) failed for %s, m_sock_fd: %d, errno : %d , errstr : %s", get_client_name(), m_sock_fd, errno, strerror(errno));
           return false;
        }
 
@@ -421,7 +421,7 @@ bool csocket::set_connection_mode(void)
        tv.tv_usec = 0;
 
        if(setsockopt(m_sock_fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0) {
-               ERR("Set SO_RCVTIMEO failed for %s, m_sock_fd : %d, errno : %d , errstr : %s",
+               _E("Set SO_RCVTIMEO failed for %s, m_sock_fd : %d, errno : %d , errstr : %s",
                        get_client_name(), m_sock_fd, errno, strerror(errno));
                close();
                return false;
@@ -451,7 +451,7 @@ bool csocket::is_blocking_mode(void)
        flags = fcntl(m_sock_fd, F_GETFL);
 
        if (flags == -1) {
-               ERR("fcntl(F_GETFL) failed for %s, m_sock_fd: %d, errno : %d , errstr : %s", get_client_name(), m_sock_fd, errno, strerror(errno));
+               _E("fcntl(F_GETFL) failed for %s, m_sock_fd: %d, errno : %d , errstr : %s", get_client_name(), m_sock_fd, errno, strerror(errno));
                return false;
        }
 
@@ -473,7 +473,7 @@ bool csocket::close(void)
 {
        if (m_sock_fd >= 0) {
                if (::close(m_sock_fd) < 0) {
-                       ERR("Socket(%d) close failed, errno : %d , errstr : %s", m_sock_fd, errno, strerror(errno));
+                       _E("Socket(%d) close failed, errno : %d , errstr : %s", m_sock_fd, errno, strerror(errno));
                        return false;
                }
                m_sock_fd = -1;
index aaa43fe..fa5500e 100644 (file)
@@ -53,7 +53,7 @@ bool poller::add_fd(int fd)
        event.events = EPOLLIN | EPOLLERR | EPOLLHUP;
 
        if (epoll_ctl(m_epfd, EPOLL_CTL_ADD, fd, &event)) {
-               ERR("errno : %d , errstr : %s", errno, strerror(errno));
+               _E("errno : %d , errstr : %s", errno, strerror(errno));
                return false;
        }
 
@@ -71,12 +71,12 @@ bool poller::fill_event_queue(void)
                if (errno == EINTR)
                        return true;
 
-               ERR("Epoll failed errrno : %d , errstr : %s", errno, strerror(errno));
+               _E("Epoll failed errrno : %d , errstr : %s", errno, strerror(errno));
                return false;
        }
 
        if (nr_events == 0) {
-               ERR("Epoll timeout!");
+               _E("Epoll timeout!");
                return false;
        }
 
@@ -100,12 +100,12 @@ bool poller::poll(struct epoll_event &event)
                        m_event_queue.pop();
 
                        if (event.events & EPOLLERR) {
-                               DBG("Poll error!");
+                               _D("Poll error!");
                                return false;
                        }
 
                        if (event.events & EPOLLHUP) {
-                               INFO("Poll: Connetion is closed from the other side");
+                               _I("Poll: Connetion is closed from the other side");
                                return false;
                        }
 
index dfa0fe5..0f6a188 100644 (file)
@@ -210,20 +210,20 @@ void sensor_info::set_raw_data(const char *data, int data_len)
 
 void sensor_info::show(void)
 {
-       INFO("Type = %d", m_type);
-       INFO("ID = 0x%llx", (int64_t)m_id);
-       INFO("Privilege = %d", (int)m_privilege);
-       INFO("Name = %s", m_name.c_str());
-       INFO("Vendor = %s", m_vendor.c_str());
-       INFO("Min_range = %f", m_min_range);
-       INFO("Max_range = %f", m_max_range);
-       INFO("Resolution = %f", m_resolution);
-       INFO("Min_interval = %d", m_min_interval);
-       INFO("Fifo_count = %d", m_fifo_count);
-       INFO("Max_batch_count = %d", m_max_batch_count);
-       INFO("supported_event = 0x%x", m_supported_event);
-
-       INFO("Wakeup_supported = %d", m_wakeup_supported);
+       _I("Type = %d", m_type);
+       _I("ID = 0x%llx", (int64_t)m_id);
+       _I("Privilege = %d", (int)m_privilege);
+       _I("Name = %s", m_name.c_str());
+       _I("Vendor = %s", m_vendor.c_str());
+       _I("Min_range = %f", m_min_range);
+       _I("Max_range = %f", m_max_range);
+       _I("Resolution = %f", m_resolution);
+       _I("Min_interval = %d", m_min_interval);
+       _I("Fifo_count = %d", m_fifo_count);
+       _I("Max_batch_count = %d", m_max_batch_count);
+       _I("supported_event = 0x%x", m_supported_event);
+
+       _I("Wakeup_supported = %d", m_wakeup_supported);
 }
 
 
index aa01eb7..2b78532 100644 (file)
@@ -36,7 +36,7 @@
 #ifdef _DEBUG
 #define DBG SLOGD
 #else
-#define DBG(...) do{} while(0)
+#define _D(...) do{} while(0)
 #endif
 
 #define ERR SLOGE
 #if defined(_DEBUG)
 #  define warn_if(expr, fmt, arg...) do { \
                if(expr) { \
-                       DBG("(%s) -> " fmt, #expr, ##arg); \
+                       _D("(%s) -> " fmt, #expr, ##arg); \
                } \
        } while (0)
 #  define ret_if(expr) do { \
                if(expr) { \
-                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       _D("(%s) -> %s() return", #expr, __FUNCTION__); \
                        return; \
                } \
        } while (0)
 #  define retv_if(expr, val) do { \
                if(expr) { \
-                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       _D("(%s) -> %s() return", #expr, __FUNCTION__); \
                        return (val); \
                } \
        } while (0)
 #  define retm_if(expr, fmt, arg...) do { \
                if(expr) { \
-                       ERR(fmt, ##arg); \
-                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       _E(fmt, ##arg); \
+                       _D("(%s) -> %s() return", #expr, __FUNCTION__); \
                        return; \
                } \
        } while (0)
 #  define retvm_if(expr, val, fmt, arg...) do { \
                if(expr) { \
-                       ERR(fmt, ##arg); \
-                       DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
+                       _E(fmt, ##arg); \
+                       _D("(%s) -> %s() return", #expr, __FUNCTION__); \
                        return (val); \
                } \
        } while (0)
@@ -83,7 +83,7 @@
 #else
 #  define warn_if(expr, fmt, arg...) do { \
                if(expr) { \
-                       ERR(fmt, ##arg); \
+                       _E(fmt, ##arg); \
                } \
        } while (0)
 #  define ret_if(expr) do { \
        } while (0)
 #  define retm_if(expr, fmt, arg...) do { \
                if(expr) { \
-                       ERR(fmt, ##arg); \
+                       _E(fmt, ##arg); \
                        return; \
                } \
        } while (0)
 #  define retvm_if(expr, val, fmt, arg...) do { \
                if(expr) { \
-                       ERR(fmt, ##arg); \
+                       _E(fmt, ##arg); \
                        return (val); \
                } \
        } while (0)