From 965d9612da0b701c472f0c5a5c66173157295c1d Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Tue, 6 Aug 2019 14:30:53 +0900 Subject: [PATCH] Fix wrong log level Change-Id: Id728e3899d043e9ec2d4fd1907df627d3b16a01b Signed-off-by: Jusung Son --- src/data_control_internal.c | 24 +++++++++++----------- src/data_control_provider.c | 48 +++++++++++++++++++++---------------------- src/data_control_sql.c | 2 +- src/data_control_sql_cursor.c | 2 +- 4 files changed, 38 insertions(+), 38 deletions(-) mode change 100755 => 100644 src/data_control_provider.c mode change 100755 => 100644 src/data_control_sql.c mode change 100755 => 100644 src/data_control_sql_cursor.c diff --git a/src/data_control_internal.c b/src/data_control_internal.c index b84a220..7c4c911 100644 --- a/src/data_control_internal.c +++ b/src/data_control_internal.c @@ -304,7 +304,7 @@ static char **__map_get_value_list(int fd, int *value_count) _LOGE("datacontrol_recv_map_get_value_list : ...from %d: fail to read\n", fd); goto ERROR; } - _LOGI("value_list[i] : %s %d" , value_list[i] , nb); + _LOGD("value_list[i] : %s %d" , value_list[i] , nb); } *value_count = count; @@ -496,7 +496,7 @@ static int __recv_sql_select_process(bundle *kb, int fd, goto out; } - _LOGE("column_type : %d", column_type); + _LOGI("column_type : %d", column_type); if (write(result_fd, &column_type, sizeof(int)) == -1) { _LOGE("Writing a column_type to a file descriptor is failed. errno = %d", errno); retval = DATA_CONTROL_ERROR_IO_ERROR; @@ -522,7 +522,7 @@ static int __recv_sql_select_process(bundle *kb, int fd, goto out; } - _LOGE("column_name_len : %d", column_name_len); + _LOGI("column_name_len : %d", column_name_len); if (write(result_fd, &column_name_len, sizeof(int)) == -1) { _LOGE("Writing a column_type to a file descriptor is failed. errno = %d", errno); retval = DATA_CONTROL_ERROR_IO_ERROR; @@ -542,8 +542,8 @@ static int __recv_sql_select_process(bundle *kb, int fd, goto out; } - _LOGE("column_name read : %d", nb); - _LOGE("column_name : %s", column_name); + _LOGD("column_name read : %d", nb); + _LOGD("column_name : %s", column_name); if (write(result_fd, column_name, column_name_len) == -1) { _LOGE("Writing a column_type to a file descriptor is failed. errno = %d", errno); retval = DATA_CONTROL_ERROR_IO_ERROR; @@ -563,7 +563,7 @@ static int __recv_sql_select_process(bundle *kb, int fd, goto out; } - _LOGE("total_len_of_column_names : %d", total_len_of_column_names); + _LOGI("total_len_of_column_names : %d", total_len_of_column_names); if (write(result_fd, &total_len_of_column_names, sizeof(int)) == -1) { _LOGE("Writing a total_len_of_column_names to a file descriptor is failed. errno = %d", errno); retval = DATA_CONTROL_ERROR_IO_ERROR; @@ -583,7 +583,7 @@ static int __recv_sql_select_process(bundle *kb, int fd, goto out; } - _LOGE("row_count : %lld", row_count); + _LOGI("row_count : %lld", row_count); if (write(result_fd, &row_count, sizeof(row_count)) == -1) { _LOGE("Writing a row_count to a file descriptor is failed. errno = %d", errno); retval = DATA_CONTROL_ERROR_IO_ERROR; @@ -600,7 +600,7 @@ static int __recv_sql_select_process(bundle *kb, int fd, cursor->row_offset_list[0] = lseek(result_fd, 0, SEEK_CUR); cursor->resultset_content_offset = cursor->row_offset_list[0]; - _LOGE("resultset_content_offset : %lld", + _LOGI("resultset_content_offset : %lld", (unsigned long long)cursor->resultset_content_offset); off_t row_offset = 0; @@ -613,7 +613,7 @@ static int __recv_sql_select_process(bundle *kb, int fd, retval = DATA_CONTROL_ERROR_IO_ERROR; goto out; } - _LOGE("type : %d", type); + _LOGI("type : %d", type); if (write(result_fd, &type, sizeof(int)) == -1) { _LOGE("Writing a type to a file descriptor is failed. errno = %d", errno); retval = DATA_CONTROL_ERROR_IO_ERROR; @@ -627,7 +627,7 @@ static int __recv_sql_select_process(bundle *kb, int fd, goto out; } - _LOGE("size : %d", size); + _LOGI("size : %d", size); if (write(result_fd, &size, sizeof(int)) == -1) { _LOGE("Writing a size to a file descriptor is failed. errno = %d", errno); retval = DATA_CONTROL_ERROR_IO_ERROR; @@ -2020,7 +2020,7 @@ char *_get_encoded_db_path() _LOGE("fail to dup db path. out of memory."); free(encoded_appid); - _LOGI("dup db path : %s ", dup_db_path); + _LOGD("dup db path : %s ", dup_db_path); return dup_db_path; } @@ -2050,7 +2050,7 @@ char *_get_encoded_path(data_control_h provider, char *consumer_appid) snprintf(full_path, full_path_len, "%s%s", DATA_CONTROL_DBUS_PATH_PREFIX, encoded_path); - _LOGI("full path : %s ", full_path); + _LOGD("full path : %s ", full_path); out: if (path) free(path); diff --git a/src/data_control_provider.c b/src/data_control_provider.c old mode 100755 new mode 100644 index da06ae5..71bdb00 --- a/src/data_control_provider.c +++ b/src/data_control_provider.c @@ -389,7 +389,7 @@ static int __init_changed_noti_consumer_list() "SELECT app_id, object_path, unique_id, provider_id, data_id " \ "FROM data_control_consumer_path_list"); - _LOGI("__init_changed_noti_consumer_list query : %s", query); + _LOGD("__init_changed_noti_consumer_list query : %s", query); ret = sqlite3_prepare_v2(__provider_db, query, -1, &stmt, NULL); if (ret != SQLITE_OK) { _LOGE("prepare stmt fail"); @@ -549,7 +549,7 @@ static int __create_consumer_list_db() db_path = _get_encoded_db_path(); if (db_path == NULL) return DATA_CONTROL_ERROR_IO_ERROR; - _LOGI("data-control provider db path : %s", db_path); + _LOGD("data-control provider db path : %s", db_path); ret = sqlite3_open_v2(db_path, &__provider_db, open_flags, NULL); free(db_path); @@ -629,7 +629,7 @@ static int __insert_consumer_list_db_info(char *app_id, char *provider_id, "provider_id, data_id, unique_id, object_path)" \ "VALUES (%Q, %Q, %Q, %Q, %Q)", app_id, provider_id, data_id, unique_id, object_path); - _LOGI("consumer list db insert sql : %s", query); + _LOGD("consumer list db insert sql : %s", query); r = sqlite3_exec(__provider_db, query, NULL, NULL, &error); if (r != SQLITE_OK) { @@ -755,7 +755,7 @@ static bundle *__set_result(bundle *b, datacontrol_request_type type, void *data request_type = bundle_get_val(b, OSP_K_DATACONTROL_REQUEST_TYPE); if (request_type) strncpy(type_str, request_type, MAX_LEN_DATACONTROL_REQ_TYPE - 1); - _LOGI("type is %s", type_str); + _LOGD("type is %s", type_str); } else { snprintf(type_str, MAX_LEN_DATACONTROL_REQ_TYPE, "%d", (int)type); @@ -994,26 +994,26 @@ static int __send_select_result(int fd, bundle *b, void *data) column_name_len = strlen(column_name) + 1; if (_write_socket(fd, &column_name_len, sizeof(int), &nb) != DATA_CONTROL_ERROR_NONE) { - _LOGI("Writing a column_name_len to a file descriptor is failed. errno = %d", errno); + _LOGE("Writing a column_name_len to a file descriptor is failed. errno = %d", errno); return DATA_CONTROL_ERROR_IO_ERROR; } - _LOGI("Writing a column_name_len %d", column_name_len); + _LOGD("Writing a column_name_len %d", column_name_len); if (_write_socket(fd, column_name, column_name_len, &nb) != DATA_CONTROL_ERROR_NONE) { - _LOGI("Writing a column_name to a file descriptor is failed. errno = %d", errno); + _LOGE("Writing a column_name to a file descriptor is failed. errno = %d", errno); return DATA_CONTROL_ERROR_IO_ERROR; } total_len_of_column_names += strlen(column_name); - _LOGI("Writing a column_name %s", column_name); + _LOGD("Writing a column_name %s", column_name); } } /* 4. total length of column names */ if (_write_socket(fd, &total_len_of_column_names, sizeof(int), &nb) != DATA_CONTROL_ERROR_NONE) { - _LOGI("Writing a total_len_of_column_names to a file descriptor is failed. errno = %d", errno); + _LOGE("Writing a total_len_of_column_names to a file descriptor is failed. errno = %d", errno); return DATA_CONTROL_ERROR_IO_ERROR; } @@ -1214,7 +1214,7 @@ static int __send_get_value_result(int fd, bundle *b, void *data) return DATA_CONTROL_ERROR_IO_ERROR; } - _LOGI("value_list = %s", value_list[i]); + _LOGD("value_list = %s", value_list[i]); if (_write_socket(fd, value_list[i], length, &nb) != DATA_CONTROL_ERROR_NONE) { _LOGE("Writing a value_list to a file descriptor is failed. errno = %d", errno); @@ -1668,12 +1668,12 @@ int __provider_process(bundle *b, int fd, const char *consumer_appid) while (current < column_count) { column_list[current++] = arg_list[i++]; /* Column data */ - _LOGI("Column %d: %s", current, column_list[current-1]); + _LOGD("Column %d: %s", current, column_list[current-1]); } const char *where = arg_list[i++]; /* where */ const char *order = arg_list[i++]; /* order */ - _LOGI("where: %s, order: %s", where, order); + _LOGD("where: %s, order: %s", where, order); if (strncmp(where, DATACONTROL_EMPTY, strlen(DATACONTROL_EMPTY)) == 0) where = NULL; @@ -1705,7 +1705,7 @@ int __provider_process(bundle *b, int fd, const char *consumer_appid) case DATACONTROL_TYPE_SQL_INSERT: case DATACONTROL_TYPE_SQL_UPDATE: { - _LOGI("INSERT / UPDATE handler"); + _LOGD("INSERT / UPDATE handler"); bundle *sql = __get_bundle_data_from_fd(fd); if (sql == NULL) { _LOGE("__get_bundle_data_from_fd fail"); @@ -1723,7 +1723,7 @@ int __provider_process(bundle *b, int fd, const char *consumer_appid) } } else { const char *where = arg_list[PACKET_INDEX_UPDATEWHERE]; - _LOGI("UPDATE from where: %s", where); + _LOGD("UPDATE from where: %s", where); if (strncmp(where, DATACONTROL_EMPTY, strlen(DATACONTROL_EMPTY)) == 0) where = NULL; if (sql_callback.update_cb) { @@ -1765,7 +1765,7 @@ int __provider_process(bundle *b, int fd, const char *consumer_appid) case DATACONTROL_TYPE_SQL_DELETE: { const char *where = arg_list[PACKET_INDEX_DELETEWHERE]; - _LOGI("DELETE from where: %s", where); + _LOGD("DELETE from where: %s", where); if (strncmp(where, DATACONTROL_EMPTY, strlen(DATACONTROL_EMPTY)) == 0) where = NULL; if (sql_callback.delete_cb) { @@ -1786,7 +1786,7 @@ int __provider_process(bundle *b, int fd, const char *consumer_appid) const char *count_per_page = arg_list[PACKET_INDEX_MAP_COUNT_PER_PAGE]; bundle_add_str(value, RESULT_PAGE_NUMBER, page_number); bundle_add_str(value, MAX_COUNT_PER_PAGE, count_per_page); - _LOGI("Gets the value list related with the key(%s) from Map datacontrol. ", map_key); + _LOGD("Gets the value list related with the key(%s) from Map datacontrol. ", map_key); if (map_callback.get_cb) { map_callback.get_cb( provider_req_id, @@ -1803,7 +1803,7 @@ int __provider_process(bundle *b, int fd, const char *consumer_appid) const char *map_key = arg_list[PACKET_INDEX_MAP_KEY]; const char *old_value = arg_list[PACKET_INDEX_MAP_VALUE_1ST]; const char *new_value = arg_list[PACKET_INDEX_MAP_VALUE_2ND]; - _LOGI("Sets the old value(%s) of the key(%s) to the new value(%s) in Map datacontrol.", old_value, map_key, new_value); + _LOGD("Sets the old value(%s) of the key(%s) to the new value(%s) in Map datacontrol.", old_value, map_key, new_value); if (map_callback.set_cb) { map_callback.set_cb( provider_req_id, @@ -1821,7 +1821,7 @@ int __provider_process(bundle *b, int fd, const char *consumer_appid) { const char *map_key = arg_list[PACKET_INDEX_MAP_KEY]; const char *map_value = arg_list[PACKET_INDEX_MAP_VALUE_1ST]; - _LOGI("Adds the %s-%s in Map datacontrol.", map_key, map_value); + _LOGD("Adds the %s-%s in Map datacontrol.", map_key, map_value); if (map_callback.add_cb) { map_callback.add_cb( provider_req_id, @@ -1860,7 +1860,7 @@ int __provider_process(bundle *b, int fd, const char *consumer_appid) { const char *map_key = arg_list[PACKET_INDEX_MAP_KEY]; const char *map_value = arg_list[PACKET_INDEX_MAP_VALUE_1ST]; - _LOGI("Removes the %s-%s in Map datacontrol.", map_key, map_value); + _LOGD("Removes the %s-%s in Map datacontrol.", map_key, map_value); if (map_callback.remove_cb) { map_callback.remove_cb( provider_req_id, @@ -2491,7 +2491,7 @@ EXPORT_API char *data_control_provider_create_insert_statement( strncat(sql, cols->vals[index], sql_len - (strlen(sql) + 1)); strncat(sql, ")", sql_len - (strlen(sql) + 1)); - _LOGI("SQL statement is: %s", sql); + _LOGD("SQL statement is: %s", sql); for (index = 0; index < row_count; index++) { free(cols->keys[index]); @@ -2537,7 +2537,7 @@ EXPORT_API char *data_control_provider_create_delete_statement( strncat(sql, where, sql_len - (strlen(sql) + 1)); } - _LOGI("SQL statement is: %s", sql); + _LOGD("SQL statement is: %s", sql); free(data_id); return sql; @@ -2620,7 +2620,7 @@ EXPORT_API char *data_control_provider_create_update_statement( strncat(sql, where, sql_len - (strlen(sql) + 1)); } - _LOGI("SQL statement is: %s", sql); + _LOGD("SQL statement is: %s", sql); for (index = 0; index < row_count; index++) { free(cols->keys[index]); @@ -2699,7 +2699,7 @@ EXPORT_API char *data_control_provider_create_select_statement( strncat(sql, order, sql_len - (strlen(sql) + 1)); } - _LOGI("SQL statement is: %s", sql); + _LOGD("SQL statement is: %s", sql); free(data_id); return sql; @@ -3083,7 +3083,7 @@ EXPORT_API int data_control_provider_foreach_data_change_consumer( "SELECT app_id, unique_id " \ "FROM data_control_consumer_path_list " \ "WHERE provider_id = ? AND data_id = ?"); - _LOGI("get_changed_noti_consumer_list query : %s", query); + _LOGD("get_changed_noti_consumer_list query : %s", query); ret = sqlite3_prepare_v2(__provider_db, query, -1, &stmt, NULL); if (ret != SQLITE_OK) { diff --git a/src/data_control_sql.c b/src/data_control_sql.c old mode 100755 new mode 100644 index 5c79b14..f59f7cd --- a/src/data_control_sql.c +++ b/src/data_control_sql.c @@ -351,7 +351,7 @@ EXPORT_API int data_control_sql_select_with_page(data_control_h provider, if (retval != DATA_CONTROL_ERROR_NONE) return retval; - _LOGI("SQL data control, select to provider_id: %s, data_id: %s, \ + _LOGD("SQL data control, select to provider_id: %s, data_id: %s, \ col_count: %d, where: %s, order: %s, page_number: %d, \ per_page: %d", provider->provider_id, provider->data_id, diff --git a/src/data_control_sql_cursor.c b/src/data_control_sql_cursor.c old mode 100755 new mode 100644 index 27b0a6c..eb0a6fb --- a/src/data_control_sql_cursor.c +++ b/src/data_control_sql_cursor.c @@ -225,7 +225,7 @@ EXPORT_API int data_control_sql_get_column_name(result_set_cursor cursor, memset(name, 0, column_len); memcpy(name, col_name, column_len); free(col_name); - _LOGI("The column name is %s", name); + _LOGD("The column name is %s", name); return DATA_CONTROL_ERROR_NONE; -- 2.7.4