From 3f59fa85cbb2a7e0f1ca58b1536fb625778924be Mon Sep 17 00:00:00 2001 From: Woongsuk Cho Date: Fri, 27 Jul 2018 13:17:15 +0900 Subject: [PATCH] use proper dlog tag Change-Id: I85a5cd0c5aec1ceb12a35edbf9d50365d7862396 --- .../installer-plugin/prefer_dotnet_aot_plugin.cc | 2 +- NativeLauncher/launcher/dotnet/dotnet_launcher.cc | 12 ++++++++---- NativeLauncher/launcher/launcher.cc | 11 +++++++---- NativeLauncher/launcher/main.cc | 15 +++++++-------- NativeLauncher/util/log_manager.cc | 16 ++++++++-------- NativeLauncher/util/path_manager.cc | 4 +++- NativeLauncher/util/plugin_manager.cc | 4 +++- 7 files changed, 37 insertions(+), 27 deletions(-) diff --git a/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc b/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc index 24a618a..799861a 100644 --- a/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc +++ b/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc @@ -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; diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc index d11c8f0..2e65927 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc @@ -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) diff --git a/NativeLauncher/launcher/launcher.cc b/NativeLauncher/launcher/launcher.cc index b0f3e1b..04eef9b 100644 --- a/NativeLauncher/launcher/launcher.cc +++ b/NativeLauncher/launcher/launcher.cc @@ -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; } diff --git a/NativeLauncher/launcher/main.cc b/NativeLauncher/launcher/main.cc index 9522496..e62e42e 100644 --- a/NativeLauncher/launcher/main.cc +++ b/NativeLauncher/launcher/main.cc @@ -63,7 +63,7 @@ extern "C" int realMain(int argc, char *argv[], const char* mode) std::unique_ptr 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; } } diff --git a/NativeLauncher/util/log_manager.cc b/NativeLauncher/util/log_manager.cc index 84ae4c0..2268389 100644 --- a/NativeLauncher/util/log_manager.cc +++ b/NativeLauncher/util/log_manager.cc @@ -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; } diff --git a/NativeLauncher/util/path_manager.cc b/NativeLauncher/util/path_manager.cc index 99446ed..1da1a65 100644 --- a/NativeLauncher/util/path_manager.cc +++ b/NativeLauncher/util/path_manager.cc @@ -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; } diff --git a/NativeLauncher/util/plugin_manager.cc b/NativeLauncher/util/plugin_manager.cc index 563eaa3..172f302 100644 --- a/NativeLauncher/util/plugin_manager.cc +++ b/NativeLauncher/util/plugin_manager.cc @@ -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; } -- 2.7.4