use proper dlog tag 05/185205/1
authorWoongsuk Cho <ws77.cho@samsung.com>
Fri, 27 Jul 2018 04:17:15 +0000 (13:17 +0900)
committerWoongsuk Cho <ws77.cho@samsung.com>
Fri, 27 Jul 2018 04:17:15 +0000 (13:17 +0900)
Change-Id: I85a5cd0c5aec1ceb12a35edbf9d50365d7862396

NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc
NativeLauncher/launcher/dotnet/dotnet_launcher.cc
NativeLauncher/launcher/launcher.cc
NativeLauncher/launcher/main.cc
NativeLauncher/util/log_manager.cc
NativeLauncher/util/path_manager.cc
NativeLauncher/util/plugin_manager.cc

index 24a618a..799861a 100644 (file)
@@ -61,7 +61,7 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char *pkgId, const char *app
                        _ERR("Failed to get root path from [%s]", pkgId);
                        return -1;
                } else {
-                       _DBG("Complete make application to native image");
+                       _INFO("Complete make application to native image");
                }
        }
        return 0;
index d11c8f0..2e65927 100644 (file)
@@ -127,7 +127,7 @@ CoreRuntime::CoreRuntime(const char* mode) :
        fd(0),
        __initialized(false)
 {
-       _DBG("Constructor called!!");
+       _INFO("Constructor called!!");
 
        // plugin initialize should be called before start loader mainloop.
        // In case of VD plugins, attaching secure zone is done in the plugin_initialize().
@@ -217,7 +217,7 @@ int CoreRuntime::initialize(bool standalone)
 
 #undef CORELIB_RETURN_IF_NOSYM
 
-       _DBG("libcoreclr dlopen and dlsym success");
+       _INFO("libcoreclr dlopen and dlsym success");
 
        if (!standalone)
                pluginPreload();
@@ -238,6 +238,8 @@ int CoreRuntime::initialize(bool standalone)
 
        __initialized = true;
 
+       _INFO("CoreRuntime initialize success");
+
        return 0;
 }
 
@@ -279,7 +281,7 @@ bool CoreRuntime::initializeCoreClr(const char* appId,
 
        pluginSetCoreclrInfo(__hostHandle, __domainId, createDelegate);
 
-       _DBG("Initialize core clr success");
+       _INFO("Initialize core clr success");
        return true;
 }
 
@@ -305,7 +307,7 @@ void CoreRuntime::dispose()
 
        __envList.clear();
 
-       _DBG("Dotnet runtime disposed");
+       _INFO("Dotnet runtime disposed");
 }
 
 int CoreRuntime::launch(const char* appId, const char* root, const char* path, int argc, char* argv[])
@@ -341,6 +343,8 @@ int CoreRuntime::launch(const char* appId, const char* root, const char* path, i
 
        pluginBeforeExecute();
 
+       _INFO("execute assembly : %s", path);
+
        unsigned int ret = 0;
        int st = executeAssembly(__hostHandle, __domainId, argc, (const char**)argv, path, &ret);
        if (st < 0)
index b0f3e1b..04eef9b 100644 (file)
@@ -126,13 +126,16 @@ static void preCreateWindow(bundle *extra, int type, void *userData)
 
        // Precreate window
        elmInitCnt = elm_init(__argc, __argv);
-       _DBG("[candidate] elm init, returned: %d", elmInitCnt);
+       if (!elmInitCnt) {
+               _ERR("[candidate] elm_init() failed");
+               return;
+       }
 
        elm_config_accel_preference_set("hw");
 
        __win = elm_win_add(NULL, "package_name", ELM_WIN_BASIC);
        if (__win == NULL) {
-               _DBG("[candidate] elm_win_add() failed");
+               _ERR("[candidate] elm_win_add() failed");
                return;
        }
 
@@ -187,9 +190,9 @@ int LaunchpadAdapterImpl::loaderMain(int argc, char* argv[])
        adapter.add_fd = fdAdd;
        adapter.remove_fd = fdRemove;
 
-       _DBG("launchpad_loader_main is start");
+       _INFO("launchpad_loader_main is start");
        int r = launchpad_loader_main(argc, argv, &(this->callbacks), &(this->adapter), this);
-       _DBG("launchpad_loader_main is finished with [%d]", r);
+       _INFO("launchpad_loader_main is finished with [%d]", r);
 
        return r;
 }
index 9522496..e62e42e 100644 (file)
@@ -63,7 +63,7 @@ extern "C" int realMain(int argc, char *argv[], const char* mode)
        std::unique_ptr<CoreRuntime> runtime(new CoreRuntime(mode));
 
        if (standalone) {
-               _DBG("##### Run it standalone #########");
+               _INFO("##### Run it standalone #########");
                char appId[1024] = {0,};
                std::string appRoot;
                if (AUL_R_OK == aul_app_get_appid_bypid(getpid(), appId, sizeof(appId))) {
@@ -76,7 +76,7 @@ extern "C" int realMain(int argc, char *argv[], const char* mode)
                        snprintf(appId, 16, "%s", "dotnet-launcher");
                        appRoot = baseName(baseName(standalonePath));
                }
-               _DBG("AUL_APPID : %s", appId);
+               _INFO("AUL_APPID : %s", appId);
 
                if (runtime->initialize(true) != 0) {
                        _ERR("Failed to initialize");
@@ -98,14 +98,13 @@ extern "C" int realMain(int argc, char *argv[], const char* mode)
                        if (runtime->initialize(false) != 0)
                                _ERR("Failed to initialized");
                        else
-                               _DBG("Success to initialized");
+                               _INFO("Success to initialized");
                };
 
                Launchpad.onTerminate = [&runtime](const AppInfo& appInfo, int argc, char** argv) {
-                       _DBG("launch request with app path : %s", appInfo.path.c_str());
-                       _DBG("appId : %s", appInfo.id.c_str());
-                       _DBG("pkg : %s", appInfo.pkg.c_str());
-                       _DBG("type : %s", appInfo.type.c_str());
+                       _INFO("launch request with app path : %s", appInfo.path.c_str());
+                       _INFO("appId : %s", appInfo.id.c_str());
+                       _INFO("pkg : %s", appInfo.pkg.c_str());
 
                        // aul_get_app_root_path() can return NULL for error case.
                        if (appInfo.root.empty()) {
@@ -119,7 +118,7 @@ extern "C" int realMain(int argc, char *argv[], const char* mode)
                };
                int ret = Launchpad.loaderMain(argc, argv);
                if (ret < 0) {
-                       _DBG("fail to start loaderMain. candidate process is not created.");
+                       _ERR("fail to start loaderMain. candidate process is not created.");
                        return 1;
                }
        }
index 84ae4c0..2268389 100644 (file)
@@ -48,18 +48,18 @@ static void *stdlog(void*)
 int initializeLogManager()
 {
     if (setvbuf(stdout, NULL, _IOLBF, 0) < 0) {
-               _DBG("fail to make stdout line-buffered");
+               _ERR("fail to make stdout line-buffered");
                return -1;
     }
 
     if (setvbuf(stderr, NULL, _IONBF, 0) < 0) {
-               _DBG("make stderr unbuffered");
+               _ERR("make stderr unbuffered");
                return -1;
        }
 
     /* create the pipe and redirect stdout and stderr */
     if (pipe(__pfd) < 0) {
-               _DBG("fail to create pipe for logging");
+               _ERR("fail to create pipe for logging");
                return -1;
     }
 
@@ -69,18 +69,18 @@ int initializeLogManager()
 int redirectFD()
 {
        if (__pfd[1] < 0) {
-               _DBG("fail to create pipe for logging");
+               _ERR("fail to create pipe for logging");
                return -1;
        }
     // stdout
     if (dup2(__pfd[1], 1) == -1) {
-               _DBG("fail to duplicate fd to stdout");
+               _ERR("fail to duplicate fd to stdout");
                return -1;
     }
 
     // stderr
     if (dup2(__pfd[1], 2) == -1) {
-               _DBG("fail to duplicate fd to stderr");
+               _ERR("fail to duplicate fd to stderr");
                return-1;
        }
 
@@ -91,12 +91,12 @@ int runLoggingThread()
 {
     /* spawn the logging thread */
     if (pthread_create(&loggingThread, 0, stdlog, 0) != 0) {
-               _DBG("fail to create pthread");
+               _ERR("fail to create pthread");
         return -1;
     }
 
     if (pthread_detach(loggingThread) != 0) {
-               _DBG("fail to detach pthread");
+               _ERR("fail to detach pthread");
                return -1;
        }
 
index 99446ed..1da1a65 100644 (file)
@@ -47,7 +47,7 @@ int initializePathManager(const std::string& runtimeDir, const std::string& tize
 {
        __dllPath = new DllPath();
        if (!__dllPath) {
-               fprintf(stderr, "fail to allocate memory for dll path structure\n");
+               _ERR("fail to allocate memory for dll path structure\n");
                return -1;
        }
 
@@ -81,6 +81,8 @@ int initializePathManager(const std::string& runtimeDir, const std::string& tize
                }
        }
 
+       _INFO("Path manager initialize success");
+
        return 0;
 }
 
index 563eaa3..172f302 100644 (file)
@@ -31,7 +31,7 @@ int initializePluginManager(const char* mode)
                if (__pluginLib) {
                        __pluginFunc = (PluginFunc*)calloc(sizeof(PluginFunc), 1);
                        if (!__pluginFunc) {
-                               fprintf(stderr, "fail to allocate memory for plugin function structure\n");
+                               _ERR("fail to allocate memory for plugin function structure");
                                return -1;
                        }
                        __pluginFunc->initialize = (plugin_initialize_ptr)dlsym(__pluginLib, "plugin_initialize");
@@ -47,6 +47,8 @@ int initializePluginManager(const char* mode)
                        __pluginFunc->initialize(mode);
        }
 
+       _INFO("Plugin manager initialize success");
+
        return 0;
 }