SECURE_LOGD(FONT_COLOR_CYAN""fmt""FONT_COLOR_RESET, ##arg); \
} } while (false)
+#define MS_DBG_SINFO(fmt, arg...) do { if (true) { \
+ SECURE_LOGI(FONT_COLOR_CYAN""fmt""FONT_COLOR_RESET, ##arg); \
+ } } while (false)
+
+#define MS_DBG_SWARN(fmt, arg...) do { if (true) { \
+ SECURE_LOGI(FONT_COLOR_CYAN""fmt""FONT_COLOR_RESET, ##arg); \
+ } } while (false)
+
#define MS_DBG_SERR(fmt, arg...) do { if (true) { \
SECURE_LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
} } while (false)
MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "GET_FOLDER_SCAN_STATUS failed [%d]", ret);
*scan_status = status;
- MS_DBG("OK path = [%s], scan_status = [%d]", path, *scan_status);
+ MS_DBG_SLOG("OK path = [%s], scan_status = [%d]", path, *scan_status);
return ret;
}
ret = ((SET_FOLDER_SCAN_STATUS)func_array[eSET_FOLDER_SCAN_STATUS])(handle, storage_id, path, status, uid); /*dlopen*/
MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "SET_FOLDER_SCAN_STATUS failed [%d]", ret);
- MS_DBG("OK path = [%s], scan_status = [%d]", path, scan_status);
+ MS_DBG_SLOG("OK path = [%s], scan_status = [%d]", path, scan_status);
return ret;
}
mount_path = g_variant_get_string(tmp, &size);
if (mount_path != NULL) {
block_info->mount_path = strdup(mount_path);
- MS_DBG_INFO("mount_point : %s", block_info->mount_path);
+ MS_DBG_SINFO("mount_point : %s", block_info->mount_path);
}
tmp = g_variant_get_child_value(parameters, 9);
if (err != USB_ERROR_LIST_FAILED_TO_GET && device != NULL) {
mount_path = usb_device_get_mountpath(device);
if (mount_path != NULL)
- MS_DBG_WARN("mount_path [%s]", mount_path);
+ MS_DBG_SWARN("mount_path [%s]", mount_path);
}
} else {
usb_device_list_get_next(list, &device);
if (device != NULL) {
mount_path = usb_device_get_mountpath(device);
if (mount_path != NULL)
- MS_DBG_WARN("mount_path [%s]", mount_path);
+ MS_DBG_SWARN("mount_path [%s]", mount_path);
}
}
storage_path = strndup(start_path, strlen(start_path) - remain_len);
- MS_DBG_WARN("storage_path [%s]", storage_path);
+ MS_DBG_SWARN("storage_path [%s]", storage_path);
err = usb_device_get_device_list(USB_MASS_STORAGE, &list);
if (err == 0) {
if (err != USB_ERROR_LIST_FAILED_TO_GET && device != NULL) {
mount_path = usb_device_get_mountpath(device);
if (mount_path != NULL) {
- MS_DBG_WARN("mount_path [%s]", mount_path);
+ MS_DBG_SWARN("mount_path [%s]", mount_path);
if (strlen(mount_path) == strlen(storage_path)) {
if (strncmp(mount_path, storage_path, strlen(mount_path)) == 0) {
- MS_DBG_WARN("start path is mounted [%s]", start_path);
+ MS_DBG_SWARN("start path is mounted [%s]", start_path);
ret = true;
}
}
if (device != NULL) {
mount_path = usb_device_get_mountpath(device);
if (mount_path != NULL) {
- MS_DBG_WARN("mount_path [%s]", mount_path);
+ MS_DBG_SWARN("mount_path [%s]", mount_path);
if (strlen(mount_path) == strlen(storage_path)) {
if (strncmp(mount_path, storage_path, strlen(mount_path)) == 0) {
- MS_DBG_WARN("start path is mounted [%s]", start_path);
+ MS_DBG_SWARN("start path is mounted [%s]", start_path);
ret = true;
break;
}
extract_item->pid = pid;
*item = extract_item;
- MS_DBG_WARN("_msc_set_extract_item path[%s],pid[%d]", extract_item->path, extract_item->pid);
+ MS_DBG_SWARN("_msc_set_extract_item path[%s],pid[%d]", extract_item->path, extract_item->pid);
return MS_MEDIA_ERR_NONE;
}
g_mutex_lock(&extract_blocked_mutex);
if (g_extract_blocked_path != NULL) {
- MS_DBG_ERR("g_extract_blocked_path is not NULL [%s]", g_extract_blocked_path);
+ MS_DBG_SERR("g_extract_blocked_path is not NULL [%s]", g_extract_blocked_path);
MS_SAFE_FREE(g_extract_blocked_path);
}
}
} else {
if (g_extract_blocked_path != NULL) {
- MS_DBG_ERR("g_extract_blocked_path is deleted [%s]", g_extract_blocked_path);
+ MS_DBG_SERR("g_extract_blocked_path is deleted [%s]", g_extract_blocked_path);
MS_SAFE_FREE(g_extract_blocked_path);
}
}
/* check cancel path */
//MS_DBG_ERR("__msc_check_extract_stop_status...");
if ((cancel_extract_item != NULL) && (cancel_extract_item->path != NULL)) {
- MS_DBG_WARN("check cancel storage [%s][%s]", cancel_extract_item->path, start_path);
+ MS_DBG_SWARN("check cancel storage [%s][%s]", cancel_extract_item->path, start_path);
if ((strncmp(cancel_extract_item->path, start_path, strlen(cancel_extract_item->path)) == 0)
&& (cancel_extract_item->pid == -1 || cancel_extract_item->pid == pid)) {
- MS_DBG_WARN("Receive cancel request [%s][%s]. STOP scan!!", cancel_extract_item->path, start_path);
+ MS_DBG_SWARN("Receive cancel request [%s][%s]. STOP scan!!", cancel_extract_item->path, start_path);
unsigned int path_len = strlen(cancel_extract_item->path);
if (strlen(start_path) > path_len) {
g_mutex_lock(&extract_blocked_mutex);
/* check block path */
if (g_extract_blocked_path != NULL) {
- //MS_DBG_WARN("check blocked storage [%s][%s]", g_extract_blocked_path, start_path);
+ //MS_DBG_SWARN("check blocked storage [%s][%s]", g_extract_blocked_path, start_path);
if (strncmp(start_path, g_extract_blocked_path, strlen(g_extract_blocked_path)) == 0) {
- MS_DBG_ERR("Receive blocked message[%s][%s]. STOP extract!!", g_extract_blocked_path, start_path);
+ MS_DBG_SERR("Receive blocked message[%s][%s]. STOP extract!!", g_extract_blocked_path, start_path);
ret = MS_MEDIA_ERR_SCANNER_FORCE_STOP;
}
if (is_end) {
/* check cancel path */
//MS_DBG_ERR("__msc_check_stop_status...");
if ((cancel_scan_item != NULL) && (cancel_scan_item->path != NULL)) {
- MS_DBG_WARN("check blocked storage [%s][%s]", cancel_scan_item->path, start_path);
+ MS_DBG_SWARN("check blocked storage [%s][%s]", cancel_scan_item->path, start_path);
if ((strncmp(cancel_scan_item->path, start_path, strlen(cancel_scan_item->path)) == 0)
&& (cancel_scan_item->pid == -1 || cancel_scan_item->pid == pid)) {
- MS_DBG_ERR("Receive cancel request [%s][%s]. STOP scan!!", cancel_scan_item->path, start_path);
+ MS_DBG_SWARN("Receive cancel request [%s][%s]. STOP scan!!", cancel_scan_item->path, start_path);
unsigned int path_len = strlen(cancel_scan_item->path);
if (strlen(start_path) > path_len) {
g_mutex_lock(&blocked_mutex2);
/* check cancel path */
if (g_blocked_path2 != NULL) {
- MS_DBG_WARN("check blocked storage [%s][%s]", g_blocked_path2, start_path);
+ MS_DBG_SWARN("check blocked storage [%s][%s]", g_blocked_path2, start_path);
if (strncmp(start_path, g_blocked_path2, strlen(start_path)) == 0) {
MS_DBG_ERR("Receive blocked message[%s][%s]. STOP scan!!",
g_blocked_path2, start_path);
const char *trash = "$RECYCLE.BIN";
- MS_DBG_WARN("storage id [%s] start path [%s]", storage_id, start_path);
+ MS_DBG_SWARN("storage id [%s] start path [%s]", storage_id, start_path);
/* make new array for storing directory */
dir_array = g_array_new(FALSE, FALSE, sizeof(char*));
if (ms_insert_folder(handle, storage_id, new_start_path, uid) != MS_MEDIA_ERR_NONE)
MS_DBG_ERR("insert folder failed");
- MS_DBG_WARN("ms_insert_folder insert path[%s]", new_start_path);
+ MS_DBG_SWARN("ms_insert_folder insert path[%s]", new_start_path);
} else {
if (ms_set_folder_validity(handle, storage_id, new_start_path, MS_INVALID, is_recursive, uid) != MS_MEDIA_ERR_NONE)
MS_DBG_ERR("set_folder_validity failed [%d] ", scan_type);
if (strncmp(current_path, MEDIA_ROOT_PATH_DISC, strlen(MEDIA_ROOT_PATH_DISC)) != 0) {
ret = ms_check_scan_ignore(current_path, uid);
if (ret != MS_MEDIA_ERR_NONE) {
- MS_DBG_ERR("%s is ignore", current_path);
+ MS_DBG_SERR("%s is ignore", current_path);
MS_SAFE_FREE(current_path);
if (ret == MS_MEDIA_ERR_USB_UNMOUNTED)
goto STOP_SCAN;
bool is_missing = false;
ms_dir_scan_status_e scan_status = MS_DIR_SCAN_NONE;
- MS_DBG_WARN("storage id [%s] start path [%s]", storage_id, start_path);
+ MS_DBG_SWARN("storage id [%s] start path [%s]", storage_id, start_path);
/* make new array for storing directory */
dir_array = g_array_new(FALSE, FALSE, sizeof(char*));
ret = ms_check_scan_ignore(current_path, uid);
if (ret != MS_MEDIA_ERR_NONE) {
- MS_DBG_ERR("%s is ignore", current_path);
+ MS_DBG_SERR("%s is ignore", current_path);
MS_SAFE_FREE(current_path);
if (ret == MS_MEDIA_ERR_USB_UNMOUNTED)
goto STOP_SCAN;
if (scan_status == MS_DIR_SCAN_PROCESSING && g_directory_scan_processing2 != DIR_SCAN_NON_SCAN) {
- MS_DBG_ERR("%s is scanning, ignore current path, scan next path !!", current_path);
+ MS_DBG_SERR("%s is scanning, ignore current path, scan next path !!", current_path);
is_missing = true;
goto NEXT_SCAN;
} else if (scan_status == MS_DIR_SCAN_DONE) {
if (g_directory_scan_processing2 == DIR_SCAN_NON_RECURSIVE) {
- MS_DBG_ERR("%s is scan done, ignore current path, get subfolder list!!", current_path);
+ MS_DBG_SERR("%s is scan done, ignore current path, get subfolder list!!", current_path);
__msc_get_null_scan_folder_list(handle, storage_id, current_path, dir_array);
continue;
} else if (g_directory_scan_processing2 == DIR_SCAN_RECURSIVE) {
- MS_DBG_ERR("%s is scan done, ignore current path, scan next path!!", current_path);
+ MS_DBG_SERR("%s is scan done, ignore current path, scan next path!!", current_path);
is_missing = true;
goto NEXT_SCAN;
while (cur_dir_array->len != 0) {
current_path = g_array_index(cur_dir_array , char*, 0);
g_array_remove_index(cur_dir_array, 0);
- MS_DBG("current_path = [%s]", current_path);
+ MS_DBG_SLOG("current_path = [%s]", current_path);
new_path = strdup(current_path);
g_array_append_val(dir_array, new_path);
/*get the UUID of deleted folder*/
ms_get_folder_id(handle, storage_id, scan_data->msg, &folder_uuid);
- MS_DBG_WARN("[%.*s][%s] delete path", MAX_MSG_SIZE, scan_data->msg, folder_uuid);
+ MS_DBG_SWARN("[%.*s][%s] delete path", MAX_MSG_SIZE, scan_data->msg, folder_uuid);
}
if (scan_type == MS_MSG_DIRECTORY_SCANNING) {
/* check valid path */
ret = ms_check_ignore_dir(path, uid);
if (ret != MS_MEDIA_ERR_NONE) {
- MS_DBG_ERR("invalide path : %s", path);
+ MS_DBG_SERR("invalide path : %s", path);
MS_SAFE_FREE(path);
continue;
}
scan_item->pid = pid;
*item = scan_item;
- MS_DBG_WARN("path[%s],pid[%d]", scan_item->path, scan_item->pid);
+ MS_DBG_SWARN("path[%s],pid[%d]", scan_item->path, scan_item->pid);
return MS_MEDIA_ERR_NONE;
}
}
if (cur_scan_item != NULL && cur_scan_item->path != NULL) {
- MS_DBG_WARN("cur_scan_item->path[%s], cur_scan_item->pid[%d]", cur_scan_item->path, cur_scan_item->pid);
- MS_DBG_WARN("cancel_path[%s], pid[%d]", cancel_path, pid);
+ MS_DBG_SWARN("cur_scan_item->path[%s], cur_scan_item->pid[%d]", cur_scan_item->path, cur_scan_item->pid);
+ MS_DBG_SWARN("cancel_path[%s], pid[%d]", cancel_path, pid);
if ((strcmp(cur_scan_item->path, cancel_path) == 0) && (pid == cur_scan_item->pid))
ret = _msc_set_scan_item(&cancel_scan_item, cancel_path, pid);
else if ((pid == -1) && (strncmp(cur_scan_item->path, cancel_path, strlen(cancel_path)) == 0))
g_mutex_lock(&blocked_mutex2);
if (g_blocked_path2 != NULL) {
- MS_DBG_WARN("g_blocked_path is not NULL [%s]", g_blocked_path2);
+ MS_DBG_SWARN("g_blocked_path is not NULL [%s]", g_blocked_path2);
MS_SAFE_FREE(g_blocked_path2);
}
g_mutex_lock(&blocked_mutex2);
if (g_blocked_path2 != NULL) {
- MS_DBG_WARN("g_blocked_path is not NULL [%s]", g_blocked_path2);
+ MS_DBG_SWARN("g_blocked_path is not NULL [%s]", g_blocked_path2);
MS_SAFE_FREE(g_blocked_path2);
}
goto END;
}
- MS_DBG("[disc path] %s", disc_path);
+ MS_DBG_SLOG("[disc path] %s", disc_path);
memset(storage_path, 0x0, sizeof(storage_path));
SAFE_STRLCPY(storage_path, disc_path, sizeof(storage_path));
}
if (ms_check_scan_ignore(current_path, uid) != MS_MEDIA_ERR_NONE) {
- MS_DBG_ERR("%s is ignore", current_path);
+ MS_DBG_SERR("%s is ignore", current_path);
MS_SAFE_FREE(current_path);
continue;
}
/* check valid path */
ret = ms_check_ignore_dir(path, uid);
if (ret != MS_MEDIA_ERR_NONE) {
- MS_DBG_ERR("invalide path : %s", path);
+ MS_DBG_SERR("invalide path : %s", path);
MS_SAFE_FREE(path);
continue;
}
ms_connect_db(&handle, uid);
if (mount_path != NULL) {
- MS_DBG_WARN("added path [%s]", mount_path);
+ MS_DBG_SWARN("added path [%s]", mount_path);
__ms_get_added_storage_path(mount_path, &storage_id);
memset(device_id, 0x0, sizeof(device_id));
ret = ms_get_storage_id(handle, mount_path, device_id, uid);
- MS_DBG_WARN("removed path [%s %s]", mount_path, device_id);
+ MS_DBG_SWARN("removed path [%s %s]", mount_path, device_id);
if (ret == MS_MEDIA_ERR_NONE) {
ms_set_storage_validity(handle, device_id, 0, uid);
ms_sys_get_uid(&uid);
if (!strcmp(action, "mounted")) {
- MS_DBG_WARN("USB MOUNTED, mountpath : %s", mount_path);
+ MS_DBG_SWARN("USB MOUNTED, mountpath : %s", mount_path);
ms_check_mediadb(uid, &is_reset);
__ms_usb_add_event(mount_path);
} else if (!strcmp(action, "blocked")) { /*unmount->blocked stop accessing usb in time*/
- MS_DBG_WARN("USB blocked, mountpath : %s", mount_path);
+ MS_DBG_SWARN("USB blocked, mountpath : %s", mount_path);
ms_check_mediadb(uid, &is_reset);
if (!is_reset)
__ms_usb_remove_event(mount_path);
if (0 == usb_device_list_get_first(list, &device) && device != NULL) {
mount_path = usb_device_get_mountpath(device);
if (mount_path != NULL) {
- MS_DBG_WARN("mount_path [%s]", mount_path);
+ MS_DBG_SWARN("mount_path [%s]", mount_path);
storage_path = strdup(mount_path);
g_array_append_val(*added_list, storage_path);
}
if (0 == usb_device_list_get_next(list, &device) && device != NULL) {
mount_path = usb_device_get_mountpath(device);
if (mount_path != NULL) {
- MS_DBG_WARN("mount_path [%s]", mount_path);
+ MS_DBG_SWARN("mount_path [%s]", mount_path);
storage_path = strdup(mount_path);
g_array_append_val(*added_list, storage_path);
}
}
if (db_storage_path != NULL) {
- MS_DBG_WARN("%s %s", mounted_path, db_storage_path);
+ MS_DBG_SWARN("%s %s", mounted_path, db_storage_path);
if (strcmp(mounted_path, db_storage_path)) {
/* update storage path */
- MS_DBG_WARN("update storage from %s to %s", db_storage_path, mounted_path);
+ MS_DBG_SWARN("update storage from %s to %s", db_storage_path, mounted_path);
ret = ms_update_storage(handle, storage_id, mounted_path, uid);
}
MS_SAFE_FREE(db_storage_path);
} else {
/* there is no information of this storage in Media DB */
- MS_DBG_WARN("insert storage %s", mounted_path);
+ MS_DBG_SWARN("insert storage %s", mounted_path);
ret = ms_insert_storage(handle, storage_id, mounted_path, uid);
scan_type = MS_SCAN_ALL;
}
} else {
/* there is no information of this storage in Media DB */
- MS_DBG_WARN("insert storage %s", mounted_path);
+ MS_DBG_SWARN("insert storage %s", mounted_path);
ret = ms_insert_storage(handle, storage_id, mounted_path, uid);
scan_type = MS_SCAN_ALL;
}
goto END;
}
- MS_DBG("[disc path] %s", disc_path);
+ MS_DBG_SLOG("[disc path] %s", disc_path);
memset(mnt_path, 0x0, sizeof(mnt_path));
SAFE_STRLCPY(mnt_path, disc_path, sizeof(mnt_path));
if (disc_state == 1) {
MS_DBG_WARN("[DISC INSERTED][%s]", disc_type);
- MS_DBG_WARN("MOUNT PATH [%s]", mnt_path);
+ MS_DBG_SWARN("MOUNT PATH [%s]", mnt_path);
/* update storage information into media DB */
ret = ms_check_storage(handle, DATADISC_STORAGE_ID, &storage_path, &validity, uid);
fp = fopen(path, "wt");
if (fp == NULL) {
- MS_DBG_ERR("fp is NULL. file name : %s", path);
+ MS_DBG_SERR("fp is NULL. file name : %s", path);
return MS_MEDIA_ERR_INTERNAL;
}
if (strcmp(disc_type, valid_type) == 0) {
MS_DBG_WARN("[DISC INSERTED][%s]", disc_type);
- MS_DBG_WARN("MOUNT PATH [%s]", mnt_path);
+ MS_DBG_SWARN("MOUNT PATH [%s]", mnt_path);
/* check mount path */
if (!ms_config_get_str(MS_DISC_PATH, &disc_path)) {
goto END;
}
- MS_DBG("[disc path] %s", disc_path);
+ MS_DBG_SLOG("[disc path] %s", disc_path);
memset(mnt_path, 0x0, sizeof(mnt_path));
SAFE_STRLCPY(mnt_path, disc_path, sizeof(mnt_path));
ret = ms_check_storage(handle, storage_id, &storage_path, &validity, uid);
if (ret == 0) {
if (storage_path != NULL) {
- MS_DBG_WARN("##[senior mode]####[path [%s], %s]###", path, storage_path);
+ MS_DBG_SWARN("##[senior mode]####[path [%s], %s]###", path, storage_path);
if (strcmp(path, storage_path)) {
/* update storage path */
- MS_DBG_WARN("##[senior mode]update storage from %s to %s", storage_path, path);
+ MS_DBG_SWARN("##[senior mode]update storage from %s to %s", storage_path, path);
ret = ms_update_storage(handle, storage_id, path, uid);
}
MS_SAFE_FREE(storage_path);
} else {
/* there is no information of this storage in Media DB */
- MS_DBG_WARN("##[senior mode]insert storage %s", path);
+ MS_DBG_SWARN("##[senior mode]insert storage %s", path);
ret = ms_insert_storage(handle, storage_id, path, uid);
MS_DBG_WARN("##[senior mode]");
scan_type = MS_SCAN_ALL;
}
} else {
/* there is no information of this storage in Media DB */
- MS_DBG_WARN("##[senior mode]insert storage %s", path);
+ MS_DBG_SWARN("##[senior mode]insert storage %s", path);
ret = ms_insert_storage(handle, storage_id, path, uid);
MS_DBG_WARN("##[senior mode]");
scan_type = MS_SCAN_ALL;