Logs fixed
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Thu, 25 Oct 2012 17:56:08 +0000 (19:56 +0200)
committerTaejeong Lee <taejeong.lee@samsung.com>
Fri, 2 Nov 2012 07:11:25 +0000 (16:11 +0900)
[Issue#] N/A
[Bug] Many logs that informed about errors are not visible
[Problem] N/A
[Cause] They were printed using LogDebug
[Solution] LogDebug changed to LogWarning/Error

[Verification] Successfull compilation. Go through commit changes and see if
modified cases are really errors.

Change-Id: I285487e950a2d2c333cb844c744b79118a13c205

13 files changed:
src/jobs/widget_install/job_widget_install.cpp
src/jobs/widget_install/task_ace_check.cpp
src/jobs/widget_install/task_certify.cpp
src/jobs/widget_install/task_database.cpp
src/jobs/widget_install/task_encrypt_resource.cpp
src/jobs/widget_install/task_manifest_file.cpp
src/jobs/widget_install/task_plugins_copy.cpp
src/jobs/widget_install/task_remove_backup.cpp
src/jobs/widget_install/task_widget_config.cpp
src/jobs/widget_uninstall/task_db_update.cpp
src/misc/wac_widget_id.cpp
src/pkg-manager/pkgmgr_signal.cpp
src/wrt-installer/wrt_installer.cpp

index a1da7ac..ca3feb3 100755 (executable)
@@ -528,22 +528,22 @@ ConfigParserData JobWidgetInstall::getWidgetDataFromXML(
     }
     Catch(DPL::ZipInput::Exception::OpenFailed)
     {
-        LogDebug("Failed to open widget package");
+        LogError("Failed to open widget package");
         return ConfigParserData();
     }
     Catch(DPL::ZipInput::Exception::OpenFileFailed)
     {
-        LogDebug("Failed to open config.xml file");
+        LogError("Failed to open config.xml file");
         return ConfigParserData();
     }
     Catch(DPL::CopyFailed)
     {
-        LogDebug("Failed to extract config.xml file");
+        LogError("Failed to extract config.xml file");
         return ConfigParserData();
     }
     Catch(ElementParser::Exception::ParseError)
     {
-        LogDebug("Failed to parse config.xml file");
+        LogError("Failed to parse config.xml file");
         return ConfigParserData();
     }
 }
@@ -560,7 +560,7 @@ WidgetUpdateInfo JobWidgetInstall::detectWidgetUpdate(
     widgetGUID = configInfo.widget_id;
 
     if (widgetGUID.IsNull()) {
-        LogDebug("Installed widget has no GUID");
+        LogWarning("Installed widget has no GUID");
         return WidgetUpdateInfo();
     }
 
@@ -748,7 +748,7 @@ WrtDB::PackagingType JobWidgetInstall::checkPackageType(
     }
     Catch(DPL::ZipInput::Exception::OpenFailed)
     {
-        LogDebug("Failed to open widget package");
+        LogError("Failed to open widget package");
         return PKG_TYPE_UNKNOWN;
     }
 
@@ -761,7 +761,7 @@ WrtDB::PackagingType JobWidgetInstall::checkPackageType(
     }
     Catch(DPL::ZipInput::Exception::OpenFileFailed)
     {
-        LogDebug("Could not find config.xml");
+        LogWarning("Could not find ./config.xml");
     }
 
     Try
@@ -770,6 +770,7 @@ WrtDB::PackagingType JobWidgetInstall::checkPackageType(
         std::unique_ptr<DPL::ZipInput::File> configFile(
                 zipFile->OpenFile(WITH_OSP_XML));
         if (pType == PKG_TYPE_TIZEN_WEBAPP) {
+            LogWarning("Two config.xml's found. Application type is unknown.");
             return PKG_TYPE_UNKNOWN;
         }
 
@@ -777,10 +778,12 @@ WrtDB::PackagingType JobWidgetInstall::checkPackageType(
     }
     Catch(DPL::ZipInput::Exception::OpenFileFailed)
     {
-        LogDebug("Could not find wgt/config.xml");
-        return PKG_TYPE_UNKNOWN;
+        LogWarning("Could not find ./res/wgt/config.xml");
     }
 
+    if (pType == PKG_TYPE_UNKNOWN) {
+        LogWarning("config.xml not found. Application type is unknown.");
+    }
     return pType;
 }
 
index 6f45eaa..a8a6a6e 100644 (file)
@@ -176,7 +176,7 @@ void TaskAceCheck::StepCheckAceResponse()
 {
     LogInfo("Checking ACE response");
     if (m_context.featureLogic->isRejected()) {
-        LogDebug("Installation failure. Some devCap was not accepted by ACE.");
+        LogError("Installation failure. Some devCap was not accepted by ACE.");
         ThrowMsg(Exceptions::NotAllowed, "Instalation failure. "
             "Some deviceCap was not accepted by ACE.");
     }
index a958288..f060447 100755 (executable)
@@ -277,7 +277,7 @@ void TaskCertify::stepSignature()
                 data.getStorageType().contains(CertStoreId::DEVELOPER);
 
             if (testCertificate && !developerMode) {
-                LogDebug("Widget signed by test certificate, "
+                LogError("Widget signed by test certificate, "
                          "but developer mode is off.");
                 ThrowMsg(Exceptions::InvalidPackage,
                          "Widget signed by test certificate, "
@@ -285,12 +285,12 @@ void TaskCertify::stepSignature()
             }
             m_contextData.widgetConfig.isTestWidget = testCertificate;
         } Catch(ParserSchemaException::Base) {
-            LogDebug("Error occured in ParserSchema.");
+            LogError("Error occured in ParserSchema.");
             ReThrowMsg(Exceptions::InvalidPackage,
                        "Error occured in ParserSchema.");
         }
         Catch(DeveloperModeValidator::Exception::Base) {
-            LogDebug("Cannot validate developer certificate.");
+            LogError("Cannot validate developer certificate.");
             ReThrowMsg(Exceptions::InvalidPackage,
                        "Cannot validate developer certificate.");
         }
index 6117b4e..759112b 100644 (file)
@@ -77,12 +77,12 @@ void TaskDatabase::StepDBInsert()
     }
     Catch(WidgetDAO::Exception::DatabaseError)
     {
-        LogWarning("Database failure!");
+        LogError("Database failure!");
         ReThrowMsg(Exceptions::InsertNewWidgetFailed, "Database failure!");
     }
     Catch(DPL::DB::SqlConnection::Exception::Base)
     {
-        LogDebug("Database failure!");
+        LogError("Database failure!");
         ReThrowMsg(Exceptions::InsertNewWidgetFailed, "Database failure!");
     }
 
index dcec387..cbcf554 100644 (file)
@@ -147,7 +147,7 @@ void TaskEncryptResource::EncryptFile(const std::string &fileName)
 
             FILE* resFp = fopen(fileName.c_str(), "r");
             if ( NULL == resFp) {
-                LogDebug("Couldnot open file : " << fileName);
+                LogError("Couldnot open file : " << fileName);
                 return;
             }
 
index 7951e2e..0c97454 100644 (file)
@@ -369,11 +369,11 @@ void TaskManifestFile::updateAilInfo()
 
     if (AIL_ERROR_NO_DATA == ret) {
         if (ail_desktop_add(pkgname) < 0) {
-            LogDebug("Failed to add ail desktop : " << pkgname);
+            LogWarning("Failed to add ail desktop : " << pkgname);
         }
     } else if (AIL_ERROR_OK == ret) {
         if (ail_desktop_update(pkgname) < 0) {
-            LogDebug("Failed to update ail desktop : " << pkgname);
+            LogWarning("Failed to update ail desktop : " << pkgname);
         }
     }
 }
index a0fbecc..528f12e 100644 (file)
@@ -96,7 +96,7 @@ void TaskPluginsCopy::StepFindPlugins()
     while ((entry = readdir(dir)) != NULL){
         tempname = m_npsource + "/" + entry->d_name;
         if(lstat(tempname.c_str(), &st) != 0) {
-            LogDebug("Failed to call \"lstat\" (errno:" <<errno
+            LogWarning("Failed to call \"lstat\" (errno:" <<errno
                     <<") on entry - skipping");
             continue;
         }
index 0067c47..f23ea70 100644 (file)
@@ -78,7 +78,7 @@ void TaskRemoveBackupFiles::StepRemoveBackupFiles()
     if (WrtUtilRemove(backupDir.str())) {
         LogDebug("Success to remove backup files : " << backupDir.str());
     } else {
-        LogDebug("Failed to remove backup directory : " << backupDir.str());
+        LogError("Failed to remove backup directory : " << backupDir.str());
         ThrowMsg(Exceptions::RemoveBackupFailed,
                  "Error occurs during removing existing folder");
     }
@@ -87,7 +87,7 @@ void TaskRemoveBackupFiles::StepRemoveBackupFiles()
     if (WrtUtilRemove(tmp)) {
         LogDebug("Success to remove temp directory : " << tmp);
     } else {
-        LogDebug("Failed to remove temp directory : " << tmp);
+        LogError("Failed to remove temp directory : " << tmp);
         ThrowMsg(Exceptions::RemoveBackupFailed,
                  "Error occurs during removing existing folder");
     }
index dc0d3f9..66f4eea 100644 (file)
@@ -667,7 +667,7 @@ bool TaskWidgetConfig::parseConfigurationFileBrowser(WrtDB::ConfigParserData& co
     }
     Catch(ElementParser::Exception::Base)
     {
-        LogDebug("Invalid widget configuration file!");
+        LogError("Invalid widget configuration file!");
         *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
         return false;
     }
@@ -713,7 +713,7 @@ bool TaskWidgetConfig::parseConfigurationFileWidget(WrtDB::ConfigParserData& con
                 }
                 Catch(ElementParser::Exception::Base)
                 {
-                    LogDebug("Invalid widget configuration file!");
+                    LogError("Invalid widget configuration file!");
                     //                    _rethrown_exception.Dump();
                     *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
                     if (-1 == TEMP_FAILURE_RETRY(closedir(dir))) {
@@ -735,7 +735,7 @@ bool TaskWidgetConfig::parseConfigurationFileWidget(WrtDB::ConfigParserData& con
 
     //We must have config.xml so leaveing if we doesn't
     if (!has_config_xml) {
-        LogDebug("Invalid archive");
+        LogError("Invalid archive");
         *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
         return false;
     }
@@ -795,7 +795,7 @@ bool TaskWidgetConfig::fillWidgetConfig(WrtDB::WidgetRegisterInfo& pWidgetConfig
             pWidgetConfigInfo.guid = configInfo.widget_id;
         } else {
             if (pWidgetConfigInfo.guid != configInfo.widget_id) {
-                LogDebug("Invalid archive");
+                LogError("Invalid archive");
                 return false;
             }
         }
@@ -805,7 +805,7 @@ bool TaskWidgetConfig::fillWidgetConfig(WrtDB::WidgetRegisterInfo& pWidgetConfig
             pWidgetConfigInfo.pkgname = configInfo.tizenId;
         } else {
             if (pWidgetConfigInfo.pkgname != configInfo.tizenId) {
-                LogDebug("Invalid archive - Tizen ID not same error");
+                LogError("Invalid archive - Tizen ID not same error");
                 return false;
             }
         }
@@ -815,7 +815,7 @@ bool TaskWidgetConfig::fillWidgetConfig(WrtDB::WidgetRegisterInfo& pWidgetConfig
             pWidgetConfigInfo.version = configInfo.version;
         } else {
             if (pWidgetConfigInfo.version != configInfo.version) {
-                LogDebug("Invalid archive");
+                LogError("Invalid archive");
                 return false;
             }
         }
index a7db085..2b6bf76 100644 (file)
@@ -51,7 +51,7 @@ void TaskDbUpdate::StepDbUpdate()
     }
     Catch(DPL::DB::SqlConnection::Exception::Base)
     {
-        LogDebug("Failed to handle StepDbUpdate!");
+        LogError("Failed to handle StepDbUpdate!");
         ReThrowMsg(Exceptions::DatabaseFailure,
                    "Failed to handle StepDbUpdate!");
     }
index 1acbb52..f6af03f 100644 (file)
@@ -64,7 +64,7 @@ void WacWidgetId::parse(const char *url)
             iri(iri_parse(url), iri_destroy);
 
     if (!iri.get()) {
-        LogDebug("Error in parsing widget id.");
+        LogError("Error in parsing widget id.");
         return; // m_schemaMatch == false;
     }
 
index 700d670..13b32b5 100644 (file)
@@ -51,7 +51,7 @@ bool PkgmgrSignal::initialize(int argc, char* argv[])
 
     m_handle = pkgmgr_installer_new();
     if(!m_handle) {
-        LogDebug("Fail to get pkgmgr installer handle");
+        LogError("Fail to get pkgmgr installer handle");
         return false;
     }
 
@@ -64,13 +64,13 @@ bool PkgmgrSignal::initialize(int argc, char* argv[])
         if (m_reqType != PKGMGR_REQ_INSTALL &&
                 m_reqType != PKGMGR_REQ_UNINSTALL)
         {
-            LogDebug("Fail to get request type of pkgmgr");
+            LogError("Fail to get request type of pkgmgr");
             pkgmgr_installer_free(m_handle);
             m_handle = NULL;
             return false;
         }
     } else {
-        LogDebug("Fail to get information of pkgmgr's request");
+        LogError("Fail to get information of pkgmgr's request");
         pkgmgr_installer_free(m_handle);
         m_handle = NULL;
         return false;
@@ -85,7 +85,7 @@ bool PkgmgrSignal::deinitialize()
 {
     if (!m_initialized)
     {
-        LogDebug("PkgmgrSingal not yet intialized");
+        LogError("PkgmgrSingal not yet intialized");
         return false;
     }
 
@@ -99,13 +99,13 @@ bool PkgmgrSignal::setPkgname(std::string name)
 {
     if (!m_initialized)
     {
-        LogDebug("PkgmgrSingal not yet intialized");
+        LogError("PkgmgrSingal not yet intialized");
         return false;
     }
 
     if (name.empty())
     {
-        LogDebug("name is empty");
+        LogError("name is empty");
         return false;
     }
 
@@ -119,7 +119,7 @@ bool PkgmgrSignal::sendSignal(std::string key, std::string value) const
 {
     if (!m_initialized)
     {
-        LogDebug("PkgmgrSingal not yet intialized");
+        LogError("PkgmgrSingal not yet intialized");
         return false;
     }
 
@@ -131,7 +131,7 @@ bool PkgmgrSignal::sendSignal(std::string key, std::string value) const
 
     if (m_handle == NULL || m_type.empty() || m_pkgname.empty())
     {
-        LogDebug("Some data of PkgmgrSignal is empty");
+        LogError("Some data of PkgmgrSignal is empty");
         return false;
     }
 
@@ -140,7 +140,7 @@ bool PkgmgrSignal::sendSignal(std::string key, std::string value) const
                 m_handle, m_type.c_str(), m_pkgname.c_str(),
                 key.c_str(), value.c_str()))
     {
-        LogDebug("Fail to send pkgmgr signal");
+        LogError("Fail to send pkgmgr signal");
         return false;
     }
 
@@ -153,7 +153,7 @@ std::string PkgmgrSignal::getPkgname() const
 {
     if (!m_initialized)
     {
-        LogDebug("PkgmgrSingal not yet intialized");
+        LogError("PkgmgrSingal not yet intialized");
     }
 
     return m_pkgname;
@@ -163,7 +163,7 @@ int PkgmgrSignal::getRequestedType() const
 {
     if (!m_initialized)
     {
-        LogDebug("PkgmgrSingal not yet intialized");
+        LogError("PkgmgrSingal not yet intialized");
     }
 
     return m_reqType;
@@ -173,7 +173,7 @@ bool PkgmgrSignal::isNoPopupRequired() const
 {
     if (!m_initialized)
     {
-        LogDebug("PkgmgrSingal not yet intialized");
+        LogError("PkgmgrSingal not yet intialized");
     }
 
     return m_noPopup;
index 11dcb57..4ec29dd 100644 (file)
@@ -598,7 +598,7 @@ void WrtInstaller::staticWrtStatusCallback(std::string tizenId,
 
     if (WRT_SUCCESS != status) {
         // Failure
-        LogDebug("Step failed");
+        LogError("Step failed");
         This->m_returnStatus = -1;
 
         if (This->popupsEnabled()) {