Add engine load failure log messages to the ERROR group 90/272090/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 8 Mar 2022 09:21:58 +0000 (18:21 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 17 Mar 2022 00:40:50 +0000 (09:40 +0900)
Change-Id: I341411c17a6c8511501d240039438df2a41faf31

plugins/wakeup-manager/src/wakeup_engine_manager.cpp

index 307ff3c..7db926c 100644 (file)
@@ -822,14 +822,15 @@ bool CWakeupEngineManager::on_wakeup_engine_command(string engine_name, mas_wake
 
 void CWakeupEngineManager::add_engine(string name, string path)
 {
-       MWR_LOGD("Name (%s), Filepath(%s)", name.c_str(), path.c_str());
+       MWR_LOGE("Name (%s), Filepath(%s)", name.c_str(), path.c_str());
 
        char* error = NULL;
        EngineInfo info;
        info.engine_handle = dlopen(path.c_str(), RTLD_LAZY);
        if (nullptr != (error = dlerror()) || nullptr == info.engine_handle) {
-               MWR_LOGD("[ERROR] Fail to dlopen(%s), error(%s)", path.c_str(), error);
+               MWR_LOGE("[ERROR] Fail to dlopen(%s), error(%s)", path.c_str(), error);
                if (info.engine_handle) dlclose(info.engine_handle);
+               info.engine_handle = nullptr;
                return;
        }
 
@@ -915,6 +916,13 @@ void CWakeupEngineManager::add_engine(string name, string path)
                (wakeup_engine_set_dependency_module_command)dlsym(info.engine_handle,
                MA_WAKEUP_ENGINE_FUNC_SET_DEPENDENCY_MODULE_COMMAND);
 
+       if (info.interface.initialize == nullptr) {
+               MWR_LOGE("[ERROR] Initialize interface does not exist, skipping %s", path.c_str());
+               if (info.engine_handle) dlclose(info.engine_handle);
+               info.engine_handle = nullptr;
+               return;
+       }
+
        info.version = 0;
        info.engine_path = path;
        info.engine_name = name;