From 53256cbefa7f338c38439bf82c5ba8eb9a226ab8 Mon Sep 17 00:00:00 2001 From: hj kim Date: Tue, 26 May 2020 16:34:27 +0900 Subject: [PATCH] Add macros for debugging and add debug logs Change-Id: I5dcd0b80f26b57d4a297898a413be863daf8062f --- include/metadata_editor_private.h | 11 +++++++++++ src/metadata_editor.cpp | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/include/metadata_editor_private.h b/include/metadata_editor_private.h index 9a96ed3..8d7eb1d 100755 --- a/include/metadata_editor_private.h +++ b/include/metadata_editor_private.h @@ -49,6 +49,10 @@ extern "C" { LOGD(""); \ } while (0) +#define metadata_editor_sec_debug(fmt, arg...) do { \ + SECURE_LOGD("" fmt "", ##arg); \ + } while (0) + #define metadata_editor_retvm_if(expr, val, fmt, arg...) do { \ if (expr) { \ LOGE("" fmt "", ##arg); \ @@ -56,6 +60,13 @@ extern "C" { } \ } while (0) +#define metadata_editor_retm_if(expr, fmt, arg...) do { \ + if (expr) { \ + LOGE("" fmt "", ##arg); \ + return; \ + } \ + } while (0) + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/src/metadata_editor.cpp b/src/metadata_editor.cpp index a383d53..74304c6 100755 --- a/src/metadata_editor.cpp +++ b/src/metadata_editor.cpp @@ -598,6 +598,8 @@ extern "C" int metadata_editor_set_path(metadata_editor_h metadata, const char * metadata_editor_retvm_if(!_metadata, METADATA_EDITOR_ERROR_INVALID_PARAMETER, "Invalid metadata"); metadata_editor_retvm_if(!path, METADATA_EDITOR_ERROR_INVALID_PARAMETER, "Invalid path"); + metadata_editor_sec_debug("path : [%s]", path); + if (access(path, R_OK) < 0) { if (errno == EACCES || errno == EPERM) { metadata_editor_error("Permission denied"); @@ -618,6 +620,8 @@ extern "C" int metadata_editor_set_path(metadata_editor_h metadata, const char * _metadata->filetype = METADATA_EDITOR_FORMAT_NOTYPE; } + metadata_editor_debug("media_type : [%d]", media_type); + try { switch (media_type) { case METADATA_EDITOR_FORMAT_MP3: -- 2.34.1