From ec3ee5ae105d9699c0076798ee786c93794fc2e2 Mon Sep 17 00:00:00 2001 From: Soyoung Kim Date: Wed, 2 Jan 2013 13:46:53 +0900 Subject: [PATCH] Add log for command [Issue#] N/A [Problem] N/A [Cause] N/A [Solution] Add to show command log. [SCMRequest] N/A Change-Id: I1285b53422e3afa3091f43aa883a0c9d58f7eecf --- src/wrt-installer/wrt_installer.cpp | 60 ++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/src/wrt-installer/wrt_installer.cpp b/src/wrt-installer/wrt_installer.cpp index 425d655..8deea1d 100644 --- a/src/wrt-installer/wrt_installer.cpp +++ b/src/wrt-installer/wrt_installer.cpp @@ -110,6 +110,15 @@ void WrtInstaller::OnStop() void WrtInstaller::OnCreate() { LogInfo("Creating DummyClient"); + fprintf(stderr, + "===========================================================\n"); + fprintf(stderr, "# wrt-installer #\n"); + fprintf(stderr, "# argc [%ld]\n", m_argc); + fprintf(stderr, "# argv[0] = [%s]\n", m_argv[0]); + fprintf(stderr, "# argv[1] = [%s]\n", m_argv[1]); + fprintf(stderr, "# argv[2] = [%s]\n", m_argv[2]); + fprintf(stderr, + "===========================================================\n"); AddStep(&WrtInstaller::initStep); @@ -373,6 +382,7 @@ void WrtInstaller::installStep() void WrtInstaller::installPluginsStep() { LogDebug("Installing plugins ..."); + fprintf(stderr,"Installing plugins ...\n"); if (m_startupPluginInstallation) { LogInfo("Plugin installation started because new plugin package found"); @@ -594,13 +604,13 @@ void WrtInstaller::staticWrtStatusCallback(std::string tizenId, if (current == &WrtInstaller::installStep) { resultMsg = DPL::FromUTF8String(PKGMGR_INSTALL_MSG); - printMsg = "installed"; + printMsg = "installation"; } else if (current == &WrtInstaller::uninstallPkgNameStep || current == &WrtInstaller::uninstallGuidStep || current == &WrtInstaller::unistallWgtFileStep) { resultMsg = DPL::FromUTF8String(PKGMGR_UNINSTALL_MSG); - printMsg = "uninstalled"; + printMsg = "uninstallation"; } if (WRT_SUCCESS != status) { @@ -619,61 +629,72 @@ void WrtInstaller::staticWrtStatusCallback(std::string tizenId, switch (status) { case WRT_INSTALLER_ERROR_INVALID_WIDGET_PACKAGE: This->m_returnStatus = 1; //this status is specific - printf("failed: invalid widget package\n"); + fprintf(stderr, "## wrt-installer : %s %s has failed - invalid widget package\n", + tizenId.c_str(), printMsg.c_str()); break; case WRT_INSTALLER_ERROR_WIDGET_DOES_NOT_EXIST: - printf("failed: widget package does not exist\n"); + fprintf(stderr, "## wrt-installer : %s %s has failed - widget package does not exist\n", + tizenId.c_str(), printMsg.c_str()); break; case WRT_INSTALLER_ERROR_ALREADY_UNINSTALLING: - printf("failed: already uninstalling\n"); + fprintf(stderr, "## wrt-installer : %s %s has failed - already uninstalling\n", + tizenId.c_str(), printMsg.c_str()); break; case WRT_INSTALLER_ERROR_OUT_OUT_DISK_SPACE: - printf("failed: out of disk space\n"); + fprintf(stderr,"## wrt-installer : %s %s has failed - out of disk space\n", + tizenId.c_str(), printMsg.c_str()); break; case WRT_INSTALLER_ERROR_INVALID_CERTIFICATE: - printf("failed: invalid certificate\n"); + fprintf(stderr,"## wrt-installer : %s %s has failed - invalid certificate\n", + tizenId.c_str(), printMsg.c_str()); break; case WRT_INSTALLER_ERROR_ALREADY_INSTALLED: - printf("failed: already installed\n"); + fprintf(stderr,"## wrt-installer : %s %s has failed - already installed\n", + tizenId.c_str(), printMsg.c_str()); break; case WRT_INSTALLER_ERROR_INTERNAL: - printf("failed: internal error\n"); + fprintf(stderr,"## wrt-installer : %s %s has failed - internal error\n", + tizenId.c_str(), printMsg.c_str()); break; case WRT_INSTALLER_ERROR_NOT_ALLOWED: - printf("failed: installation or update not allowed; invalid" - " mode\n"); + fprintf(stderr,"## wrt-installer : %s %s has failed - installation or update not allowed; invalid" + " mode\n", tizenId.c_str(), printMsg.c_str()); break; case WRT_INSTALLER_ERROR_DEFERRED: - printf("deferred: widget update will continue after the widget" + fprintf(stderr,"## wrt-installer : deferred: widget update will continue after the widget" " has been stopped\n"); break; case WRT_INSTALLER_ERROR_DATABASE_FAILURE: - printf("failed: database failure\n"); + fprintf(stderr,"## wrt-installer : %s %s has failed - database failure\n", + tizenId.c_str(), printMsg.c_str()); break; case WRT_INSTALLER_ERROR_OSPSVC: - printf("failed: during installation or uninstallation osp service\n"); + fprintf(stderr,"## wrt-installer : %s %s has failed - during installation or" + " uninstallation osp service\n", tizenId.c_str(), + printMsg.c_str()); break; case WRT_INSTALLER_ERROR_UNKNOWN: - printf("failed: unknown error\n"); + fprintf(stderr,"## wrt-installer : %s %s has failed - unknown error\n", + tizenId.c_str(), printMsg.c_str()); break; default: break; + } } else { - - printf("%s : %s\n", printMsg.c_str(), tizenId.c_str()); + fprintf(stderr, "## wrt-installer : %s %s was successful.\n", tizenId.c_str(), printMsg.c_str()); LogDebug("Status succesfull"); This->m_returnStatus = 0; resultMsg += L" : " + DPL::FromUTF8String(PKGMGR_END_SUCCESS); @@ -704,6 +725,7 @@ void WrtInstaller::staticWrtPluginInstallationCallback(WrtErrStatus status, if (This->m_numPluginsToInstall < 1) { LogDebug("All plugins installation completed"); + fprintf(stderr,"All plugins installation completed.\n"); //remove installation request if (!PluginUtils::removeInstallationRequiredFlag()) { @@ -737,6 +759,8 @@ void WrtInstaller::staticWrtPluginInstallationCallback(WrtErrStatus status, if (WRT_SUCCESS == status) { This->m_returnStatus = 0; + fprintf(stderr, "## wrt-installer : plugin installation successfull [%s]\n", + path.c_str()); LogDebug("One plugin Installation succesfull: " << path); return; } @@ -746,6 +770,8 @@ void WrtInstaller::staticWrtPluginInstallationCallback(WrtErrStatus status, if (WRT_PLUGIN_INSTALLER_ERROR_WAITING == status) { LogInfo("Plugin installation is waiting for dependencies"); + fprintf(stderr, "## wrt-installer : plugin installation failed [%s]\n", + path.c_str()); } switch (status) { -- 2.7.4