From: joogab.yun Date: Mon, 27 Nov 2023 08:39:29 +0000 (+0900) Subject: Add dlog for tizen X-Git-Tag: accepted/tizen/8.0/unified/20240729.125322~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c4400d3fcebeced0551fdaf01f17ff5fff45595;p=platform%2Fcore%2Fuifw%2Flottie-player.git Add dlog for tizen Change-Id: I941937976b3593841c63d1c7ab598fc4dfe417d3 --- diff --git a/meson.build b/meson.build index 46b1ec4..2944f32 100644 --- a/meson.build +++ b/meson.build @@ -58,6 +58,9 @@ if get_option('dumptree') == true config_h.set10('LOTTIE_DUMP_TREE_SUPPORT', true) endif +if get_option('tizen') == true + config_h.set10('TIZEN', true) +endif configure_file( output: 'config.h', diff --git a/meson_options.txt b/meson_options.txt index acc79d2..cfd5646 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -46,3 +46,8 @@ option('cmake', type: 'boolean', value: false, description: 'Enable Generating CMake config files') + +option('tizen', + type: 'boolean', + value: true, + description: 'Enable prints tizen dlogs') diff --git a/packaging/rlottie.spec b/packaging/rlottie.spec index 9cc674e..11b0989 100644 --- a/packaging/rlottie.spec +++ b/packaging/rlottie.spec @@ -6,8 +6,10 @@ Group: UI Framework/Services License: MIT and BSD and MPL-2.0 URL: http://www.tizen.org/ Source0: %{name}-%{version}.tar.gz +BuildRequires: pkgconfig BuildRequires: meson BuildRequires: ninja +BuildRequires: pkgconfig(dlog) Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig diff --git a/src/lottie/lottieanimation.cpp b/src/lottie/lottieanimation.cpp index afcc400..62e9fbb 100644 --- a/src/lottie/lottieanimation.cpp +++ b/src/lottie/lottieanimation.cpp @@ -111,6 +111,7 @@ Surface AnimationImpl::render(size_t frameNo, const Surface &surface, bool renderInProgress = mRenderInProgress.load(); if (renderInProgress) { vCritical << "Already Rendering Scheduled for this Animation"; + LOGE("Already Rendering Scheduled for this Animation\n"); return surface; } @@ -275,6 +276,7 @@ std::unique_ptr Animation::loadFromData( { if (jsonData.empty()) { vWarning << "jason data is empty"; + LOGE("jason data is empty\n"); return nullptr; } @@ -295,6 +297,7 @@ std::unique_ptr Animation::loadFromData(std::string jsonData, { if (jsonData.empty()) { vWarning << "jason data is empty"; + LOGE("jason data is empty\n"); return nullptr; } @@ -313,6 +316,7 @@ std::unique_ptr Animation::loadFromFile(const std::string &path, { if (path.empty()) { vWarning << "File path is empty"; + LOGE("File path is empty\n"); return nullptr; } diff --git a/src/lottie/lottieloader.cpp b/src/lottie/lottieloader.cpp index 8a52949..58911b5 100644 --- a/src/lottie/lottieloader.cpp +++ b/src/lottie/lottieloader.cpp @@ -126,6 +126,7 @@ std::shared_ptr model::loadFromFile(const std::string &path, if (!f.is_open()) { vCritical << "failed to open file = " << path.c_str(); + LOGE("failed to open file = %s\n", path.c_str()); return {}; } else { std::string content; @@ -133,10 +134,18 @@ std::shared_ptr model::loadFromFile(const std::string &path, std::getline(f, content, '\0'); f.close(); - if (content.empty()) return {}; + if (content.empty()) + { + LOGE("failed : content is empty\n"); + return {}; + } auto obj = internal::model::parse(const_cast(content.c_str()), dirname(path)); + if (!obj) + { + LOGE("failed : model of parse is null\n"); + } if (obj && cachePolicy) ModelCache::instance().add(path, obj); diff --git a/src/lottie/lottieparser.cpp b/src/lottie/lottieparser.cpp index e14fd5c..8c7b550 100644 --- a/src/lottie/lottieparser.cpp +++ b/src/lottie/lottieparser.cpp @@ -394,6 +394,7 @@ bool LottieParserImpl::ParseNext() if (!r_.IterativeParseNext(ss_, *this)) { vCritical << "Lottie file parsing error"; + LOGE("Lottie file parsing error\n"); st_ = kError; return false; } @@ -1142,6 +1143,7 @@ model::Object *LottieParserImpl::parseObjectTypeAttr() const char *type = GetString(); if (!type) { vWarning << "No object type specified"; + LOGE("No object type specified\n"); return nullptr; } if (0 == strcmp(type, "gr")) { @@ -1177,6 +1179,7 @@ model::Object *LottieParserImpl::parseObjectTypeAttr() return parseReapeaterObject(); } else if (0 == strcmp(type, "mm")) { vWarning << "Merge Path is not supported yet"; + LOGE("Merge Path is not supported yet\n"); return nullptr; } else { #ifdef DEBUG_PARSER @@ -2388,6 +2391,7 @@ std::shared_ptr model::parse(char * str, } vWarning << "Input data is not Lottie format!"; + LOGE( "Input data is not Lottie format!\n"); return {}; } diff --git a/src/meson.build b/src/meson.build index d93a7e3..529067f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -22,6 +22,10 @@ if get_option('thread') == true rlottie_lib_dep += dependency('threads') endif +if get_option('tizen') == true + rlottie_lib_dep += dependency('dlog', required: true) +endif + rlottie_lib = library('rlottie', include_directories : inc, version : meson.project_version(), @@ -37,6 +41,7 @@ rlottie_dep = declare_dependency( include_directories: inc, link_with : rlottie_lib) + if (cc.get_id() == 'emscripten') subdir('wasm') diff --git a/src/vector/vdebug.h b/src/vector/vdebug.h index 5b6bef5..d24fdbe 100644 --- a/src/vector/vdebug.h +++ b/src/vector/vdebug.h @@ -25,6 +25,23 @@ #include "config.h" +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "LOTTIE" + +#ifdef TIZEN +#include +#define LOGW(fmt, ...) dlog_print(DLOG_WARN, LOG_TAG, "[%s]" fmt, __func__, ##__VA_ARGS__) +#define LOGE(fmt, ...) dlog_print(DLOG_ERROR, LOG_TAG, "[%s]" fmt, __func__, ##__VA_ARGS__) +#else +#define C_RED "\e[31m" +#define C_YELLOW "\e[33m" +#define C_END "\e[0m" +#define LOGW(fmt, ...) printf(C_YELLOW "[" LOG_TAG "]" C_END "[%s]" fmt "\n", __func__, ##__VA_ARGS__) +#define LOGE(fmt, ...) printf(C_RED "[" LOG_TAG "]" C_END "[%s]" fmt "\n", __func__, ##__VA_ARGS__) +#endif + #ifdef LOTTIE_LOGGING_SUPPORT #include diff --git a/src/vector/vimageloader.cpp b/src/vector/vimageloader.cpp index c2446be..508bd77 100644 --- a/src/vector/vimageloader.cpp +++ b/src/vector/vimageloader.cpp @@ -94,22 +94,33 @@ struct VImageLoader::Impl { { if (moduleLoad()) { vWarning << "Failed to dlopen librlottie-image-loader library"; + LOGE("Failed to dlopen librlottie-image-loader library\n"); return; } init(); if (!imageLoad) + { vWarning << "Failed to find symbol lottie_image_load in " "librlottie-image-loader library"; + LOGW("Failed to find symbol lottie_image_load in librlottie-image-loader library\n"); + } + if (!imageFree) + { vWarning << "Failed to find symbol lottie_image_free in " "librlottie-image-loader library"; + LOGW("Failed to find symbol lottie_image_free in librlottie-image-loader library\n"); + } if (!imageFromData) + { vWarning << "Failed to find symbol lottie_image_load_data in " "librlottie-image-loader library"; + LOGW("Failed to find symbol lottie_image_load_data in librlottie-image-loader library\n"); + } } ~Impl() { moduleFree(); }