Added logs to help debugging regarding dynamic linking loader error.
authorTae-Jeong Lee <taejeong.lee@samsung.com>
Mon, 26 Aug 2013 14:03:57 +0000 (23:03 +0900)
committerTae-Jeong Lee <taejeong.lee@samsung.com>
Tue, 27 Aug 2013 11:41:39 +0000 (20:41 +0900)
[Issue#] N/A
[Problem] When a dependency error occured during wrt-plugins installation, the dynamic linking loader works strangely after that.
          Because of that, to help debugging, some logs were added.
[Cause] N/A
[Solution] Added some 'stderr' logs regarding dynamic linking loader error. It will show the reason of fail to dlopen().

Change-Id: I964db7d7434274549197d79655cf7eea50884ea7

src/jobs/plugin_install/plugin_install_task.cpp

index 2b90704..097f9ac 100644 (file)
@@ -176,15 +176,22 @@ void PluginInstallTask::stepLoadPluginLibrary()
 
     LogDebug("Loading plugin: " << filename.Filename());
 
+    fprintf(stderr, " - Try to dlopen() : [%s] ", filename.Fullpath().c_str());
+
     void *dlHandle = dlopen(filename.Fullpath().c_str(), RTLD_LAZY);
     if (dlHandle == NULL) {
         const char* error = (const char*)dlerror();
+        fprintf(stderr,
+                "-> Failed!\n   %s\n",
+                (error != NULL ? error : "unknown"));
         LogError(
             "Failed to load plugin: " << filename.Filename() <<
             ". Reason: " << (error != NULL ? error : "unknown"));
         ThrowMsg(Exceptions::PluginLibraryError, "Library error");
     }
 
+    fprintf(stderr, "-> Done.\n");
+
     const js_entity_definition_t *rawEntityList = NULL;
     get_widget_entity_map_proc *getWidgetEntityMapProcPtr = NULL;