#ifndef INSTALLER_LOG_H
#define INSTALLER_LOG_H
+#include <dlog.h>
#include <dpl/log/secure_log.h>
#include <dpl/string.h>
#include <dpl/binary_queue.h>
#include <dpl/assert.h>
#include <dpl/file_input.h>
-
-#include <installer_log.h>
+#include <dpl/log/log.h>
class ParserRunner::Impl
{
va_start(args, msg);
vsnprintf(buffer, 300, msg, args);
va_end(args);
- _E("%s", buffer);
+ LogError(buffer);
}
static void logWarningLibxml2(void *, const char *msg, ...)
va_start(args, msg);
vsnprintf(buffer, 300, msg, args);
va_end(args);
- _W("%s", buffer);
+ LogWarning(buffer);
}
public:
xmlSchemaPtr xschema;
ctx = xmlSchemaNewParserCtxt(schema.c_str());
if (ctx == NULL) {
- _E("xmlSchemaNewParserCtxt() Failed");
+ LogError("xmlSchemaNewParserCtxt() Failed");
return false;
}
xschema = xmlSchemaParse(ctx);
if (xschema == NULL) {
- _E("xmlSchemaParse() Failed");
+ LogError("xmlSchemaParse() Failed");
return false;
}
vctx = xmlSchemaNewValidCtxt(xschema);
if (vctx == NULL) {
- _E("xmlSchemaNewValidCtxt() Failed");
+ LogError("xmlSchemaNewValidCtxt() Failed");
return false;
}
xmlSchemaSetValidErrors(vctx, (xmlSchemaValidityErrorFunc)&logErrorLibxml2, (xmlSchemaValidityWarningFunc) &logWarningLibxml2, NULL);
ret = xmlSchemaValidateFile(vctx, filename.c_str(), 0);
if (ret == -1) {
- _E("xmlSchemaValidateFile() failed");
+ LogError("xmlSchemaValidateFile() failed");
return false;
} else if (ret == 0) {
- _E("Config is Valid");
+ LogError("Config is Valid");
return true;
} else {
- _E("Config Validation Failed with error code %d", ret);
+ LogError("Config Validation Failed with error code " << ret);
return false;
}
return true;
break;
}
default:
- _W("Ignoring Node of Type: %d", xmlTextReaderNodeType(m_reader));
+ LogWarning("Ignoring Node of Type: " <<
+ xmlTextReaderNodeType(m_reader));
break;
}
if (m_parsingError) {
- _E("Parsing error occured: %s", m_errorMsg.c_str());
+ LogError("Parsing error occured: " << m_errorMsg);
ThrowMsg(ElementParser::Exception::ParseError, m_errorMsg);
}
}
if (m_parsingError) {
- _E("Parsing error occured: %s", m_errorMsg.c_str());
+ LogError("Parsing error occured: " << m_errorMsg);
ThrowMsg(ElementParser::Exception::ParseError, m_errorMsg);
}
Catch(ElementParser::Exception::Base)
{
CleanupParserRunner();
- _E("%s", _rethrown_exception.DumpToString().c_str());
+ LogError(_rethrown_exception.DumpToString());
ReThrow(ElementParser::Exception::ParseError);
}
CleanupParserRunner();
element.lang = GetLanguageTag();
element.ns = GetNamespace();
- _D("value: %ls, lang: %ls, ns: %ls)", element.value.c_str(), element.lang.c_str(), element.ns.c_str());
+ LogDebug("value: " << element.value <<
+ ", lang: " << element.lang <<
+ ", ns: " << element.ns << ")");
parser->Accept(element);
ParseNodeElementAttributes(parser);
void ParseNodeElementAttributes(const ElementParserPtr& parser)
{
Assert(m_reader);
+
int count = xmlTextReaderAttributeCount(m_reader);
for (int i = 0; i < count; ++i) {
xmlTextReaderMoveToAttributeNo(m_reader, i);
attribute.name = GetNameWithoutNamespace();
attribute.value = GetValue();
attribute.lang = GetLanguageTag();
- _D("Attribute name: %ls, value: %ls, prefix: %ls, namespace: %ls, lang: %ls",
- attribute.name.c_str(), attribute.value.c_str(), attribute.prefix.c_str(), attribute.ns.c_str(), attribute.lang.c_str());
+ LogDebug("Attribute name: " << attribute.name <<
+ ", value: " << attribute.value <<
+ ", prefix: " << attribute.prefix <<
+ ", namespace: " << attribute.ns <<
+ ", lang: " << attribute.lang);
parser->Accept(attribute);
}
}
void ErrorHandler(const DPL::String& msg)
{
- _E("LibXML: %s", msg.c_str());
+ LogError("LibXML: " << msg);
m_parsingError = true;
m_errorMsg = m_errorMsg + DPL::FromASCIIString("\n");
m_errorMsg = m_errorMsg + msg;
void StructuredErrorHandler(xmlErrorPtr error)
{
- _E("LibXML: %s", error->message);
+ LogError("LibXML: " << error->message);
m_parsingError = true;
m_errorMsg = m_errorMsg + DPL::FromASCIIString("\n");
m_errorMsg = m_errorMsg + DPL::FromUTF8String(error->message);
#include "wrt-commons/i18n-dao-ro/i18n_dao_read_only.h"
#include <iri.h>
+#include <dpl/log/log.h>
#include <dpl/fast_delegate.h>
#include <dpl/foreach.h>
#include <dpl/scoped_ptr.h>
#include <cstdlib>
#include <locale>
-#include <installer_log.h>
-
using namespace WrtDB;
namespace Unicode {
} else if (L"rlo" == attribute.value) {
return RLO;
} else {
- _W("dir attribute has wrong value: %ls ", attribute.value.c_str());
+ LogWarning("dir attribute has wrong value:" << attribute.value);
return EMPTY;
}
}
AcceptWac(attribute);
break;
default:
- _E("Error in Access tag - unknown standard.");
+ LogError("Error in Access tag - unknown standard.");
break;
}
}
iri.set(m_strIRIOrigin, false);
if (!iri.isAccessDefinition()) {
- _W("Access list element: %ls is not acceptable by WARP standard and will be ignored!", m_strIRIOrigin.c_str());
+ LogWarning("Access list element: " <<
+ m_strIRIOrigin <<
+ " is not acceptable by WARP" <<
+ "standard and will be ignored!");
return;
}
VerifyWac();
break;
default:
- _E("Error in Access tag - unknown standard.");
+ LogError("Error in Access tag - unknown standard.");
break;
}
}
virtual void Verify()
{
if (m_src.IsNull()) {
- _W("src attribute of icon element is mandatory - ignoring");
+ LogWarning("src attribute of icon element is mandatory - ignoring");
return;
}
}
Catch(BadSrcError)
{
- _W("src attribute is invalid: %ls", (*m_src).c_str());
+ LogWarning("src attribute is invalid: " << m_src);
}
}
virtual void Verify()
{
if (m_name.IsNull()) {
- _W("preference element must have name attribute");
+ LogWarning("preference element must have name attribute");
return;
}
NormalizeString(m_name);
if (!m_value.IsNull() && *m_value == ignoreUri)
{
- _D("exception : '%ls' scheme will be ignored.", (*m_value).c_str());
+ LogDebug("exception : '" << *m_value << "' scheme will be ignored.");
m_value = DPL::OptionalString::Null;
}
{
m_data.m_uriList.insert(*m_value);
} else {
- _D("Ignoring uri with name %ls", (*m_value).c_str());
+ LogDebug("Ignoring uri with name" <<
+ DPL::ToUTF8String(*m_value));
}
}
{
m_data.m_mimeList.insert(*m_value);
} else {
- _D("Ignoring mime with name %ls", (*m_value).c_str());
+ LogDebug("Ignoring mime with name" <<
+ DPL::ToUTF8String(*m_value));
}
}
m_data.m_disposition =
ConfigParserData::AppControlInfo::Disposition::INLINE;
} else {
- _D("Ignoring dispostion value %ls", (*m_value).c_str());
+ LogDebug("Ignoring dispostion value " <<
+ DPL::ToUTF8String(*m_value));
}
}
virtual void Accept(const Element& element)
{
- _W("namespace for app service = %ls", element.ns.c_str());
+ LogWarning("namespace for app service = " << element.ns);
if (element.ns == ConfigurationNamespace::W3CWidgetNamespaceName) {
ThrowMsg(Exception::ParseError,
"Wrong xml namespace for widget element");
{
if (m_src.IsNull())
{
- _W("src attribute of splash element is mandatory - ignoring");
+ LogWarning("src attribute of splash element is mandatory - ignoring");
return;
}
virtual void Verify()
{
if (m_src.IsNull()) {
- _W(
+ LogWarning(
"src attribute of background element is mandatory - ignoring");
return;
}
{
m_properNamespace = true;
}
- _D("element");
+ LogDebug("element");
}
virtual void Accept(const XmlAttribute& attribute)
{
m_data.featuresList.insert(m_feature);
} else {
- _D("Ignoring feature with name %ls", DPL::ToUTF8String(m_feature.name).c_str());
+ LogDebug("Ignoring feature with name" <<
+ DPL::ToUTF8String(m_feature.name));
}
}
}
{
m_data.privilegeList.insert(m_privilege);
} else {
- _D("Ignoring privilege with name %ls", DPL::ToUTF8String(m_privilege.name).c_str());
+ LogDebug("Ignoring privilege with name" <<
+ DPL::ToUTF8String(m_privilege.name));
}
}
}
virtual void Verify()
{
if (m_name.IsNull()) {
- _W(
+ LogWarning(
"name attribute of category element is mandatory - ignoring");
return;
}
{
std::pair<DPL::String, DPL::String> boxLabel;
if (m_label.empty()) {
- _W("box-label element is empty");
+ LogWarning("box-label element is empty");
boxLabel.first = DPL::FromUTF8String("");
boxLabel.second = DPL::FromUTF8String("");
m_data.m_label.push_back(boxLabel);
if (*height < 1) {
m_height = L"1";
- _D("height attribute of pd element shouldn't be less than 1. Changed to 1 from %ld", *height);
+ LogDebug("height attribute of pd element shouldn't be less than 1. Changed to 1 from " << *height);
} else if (*height > 380){
m_height = L"380";
- _D("height attribute of pd element shouldn't be greater than 380. Changed to 380 from %ld", *height);
+ LogDebug("height attribute of pd element shouldn't be greater than 380. Changed to 380 from " << *height);
}
m_data.m_pdSrc = m_src;
//set standard locale to fix decimal point mark - '.'
std::string currentLocale = setlocale(LC_NUMERIC, NULL);
if (NULL == setlocale(LC_NUMERIC, "C"))
- _W("Failed to change locale to \"C\"");
+ LogWarning("Failed to change locale to \"C\"");
double updatePeriod = strtod(tempStr.c_str(), &endptr);
//go back to previous locale
if (NULL == setlocale(LC_NUMERIC, currentLocale.c_str()))
- _W("Failed to set previous locale");
+ LogWarning("Failed to set previous locale");
if ((errno == ERANGE && (updatePeriod == -HUGE_VAL || updatePeriod == HUGE_VAL))
|| *endptr != '\0') {
ThrowMsg(Exception::ParseError,
"update-period attribute of app-widget element should be a number - ignoring. current value: " << m_updatePeriod);
} else if (updatePeriod < 1800.0) {
- _D("update-period attribute of app-widget element shouldn't be less than 1800.0 - changed to 1800 from value: %s", m_updatePeriod.c_str());
+ LogDebug("update-period attribute of app-widget element shouldn't be less than 1800.0 - changed to 1800 from value: " << m_updatePeriod);
m_updatePeriod = L"1800.0";
}
}
m_data.allowNavigationEncountered = true;
if (m_origin.IsNull()) {
- _W("data is empty");
+ LogWarning("data is empty");
return;
}
// input origin should has schem and host
// in case of file scheme path is filled
// "http://"
- _W("input origin isn't verified");
+ LogWarning("input origin isn't verified");
continue;
}
DPL::String scheme = L"*";
virtual void Verify()
{
if (m_key.IsNull()) {
- _W("metadata element must have key attribute");
+ LogWarning("metadata element must have key attribute");
return;
}
NormalizeString(m_key);
ConfigParserData::Metadata metaData(m_key, m_value);
FOREACH(it, m_data.metadataList) {
if (!DPL::StringCompare(*it->key, *m_key)) {
- _E("Key isn't unique");
+ LogError("Key isn't unique");
return;
}
}
m_data.widget_id = attribute.value;
NormalizeString(m_data.widget_id);
} else {
- _W("Widget id validation failed: %ls", attribute.value.c_str());
+ LogWarning("Widget id validation failed: " << attribute.value);
}
} else if (attribute.name == L"version") {
m_version = attribute.value;
NormalizeString(m_version);
} else if (attribute.name == L"min-version") {
- _D("min-version attribute was found. Value: %ls", attribute.value.c_str());
+ LogDebug("min-version attribute was found. Value: " << attribute.value);
m_minVersion = attribute.value;
NormalizeString(m_minVersion);
m_data.minVersionRequired = m_minVersion;
NormalizeString(m_defaultlocale);
if( I18n::DB::I18nDAOReadOnly::IsValidSubTag
(attribute.value, RECORD_TYPE_LANGUAGE)) {
- _D("Default Locale Found %ls", (*m_defaultlocale).c_str());
+ LogDebug("Default Locale Found " << m_defaultlocale);
} else {
- _W("Default Locate Is Invalid");
+ LogWarning("Default Locate Is Invalid");
}
} else {
- _W("Ignoring subsequent default locale");
+ LogWarning("Ignoring subsequent default locale");
}
//Any other value consider as a namespace definition
} else if (attribute.name == L"xmlns" || attribute.prefix == L"xmlns") {
- _D("Namespace domain: %ls", attribute.name.c_str());
- _D("Namespace value: %ls", attribute.value.c_str());
+ LogDebug("Namespace domain: " << attribute.name);
+ LogDebug("Namespace value: " << attribute.value);
m_nameSpaces[attribute.name] = attribute.value;
} else {
- _E("Unknown attirbute: namespace=%ls, name=%ls, value=%ls", attribute.ns.c_str(), attribute.name.c_str(), attribute.value.c_str());
+ LogError("Unknown attirbute: namespace=" << attribute.ns <<
+ ", name=" << attribute.name <<
+ ", value=" << attribute.value);
}
}
#include <plugin_install/plugin_install_task.h>
#include "plugin_objects.h"
#include <wrt_common_types.h>
-#include <installer_log.h>
namespace Jobs {
namespace PluginInstall {
void JobPluginInstall::SendProgress()
{
if (GetProgressFlag() && GetInstallerStruct().progressCallback != NULL) {
- _D("Call Plugin install progressCallback");
+ LogDebug("Call Plugin install progressCallback");
GetInstallerStruct().progressCallback(GetInstallerStruct().userParam,
GetProgressPercent(),
GetProgressDescription());
if (handle != Jobs::PluginInstall::JobPluginInstall::INVALID_HANDLE &&
isReadyToInstall())
{
- _D("Call Plugin install success finishedCallback");
+ LogDebug("Call Plugin install success finishedCallback");
GetInstallerStruct().finishedCallback(GetInstallerStruct().userParam,
Jobs::Exceptions::Success);
} else {
- _D("Call Plugin install waiting finishedCallback");
+ LogDebug("Call Plugin install waiting finishedCallback");
GetInstallerStruct().finishedCallback(GetInstallerStruct().userParam,
Jobs::Exceptions::ErrorPluginInstallationFailed);
- _D("Installation: %s NOT possible", getFilePath().c_str());
+ LogDebug("Installation: " << getFilePath() <<
+ " NOT possible");
}
}
void JobPluginInstall::SendFinishedFailure()
{
- _E("Error in plugin installation step: %s", m_exceptionCaught);
- _E("Message: %s", m_exceptionMessage.c_str());
+ LogError("Error in plugin installation step: " << m_exceptionCaught);
+ LogError("Message: " << m_exceptionMessage);
- _D("Call Plugin install failure finishedCallback");
+ LogDebug("Call Plugin install failure finishedCallback");
GetInstallerStruct().finishedCallback(GetInstallerStruct().userParam,
m_exceptionCaught);
}
#include <dlfcn.h>
//WRT INCLUDES
+#include <dpl/log/log.h>
#include <dpl/foreach.h>
#include <job.h>
#include "plugin_install_task.h"
#include "plugin_objects.h"
#include <wrt_plugin_export.h>
#include <plugin_path.h>
-#include <installer_log.h>
using namespace WrtDB;
#define DISABLE_IF_PLUGIN_WITHOUT_LIB() \
if (m_pluginInfo.m_libraryName.empty()) \
{ \
- _W("Plugin without library."); \
+ LogWarning("Plugin without library."); \
return; \
}
void PluginInstallTask::stepCheckPluginPath()
{
- _D("Plugin installation: step CheckPluginPath");
+ LogDebug("Plugin installation: step CheckPluginPath");
if(!m_context->pluginFilePath.Exists()){
ThrowMsg(Exceptions::PluginPathFailed,
void PluginInstallTask::stepParseConfigFile()
{
- _D("Plugin installation: step parse config file");
+ LogDebug("Plugin installation: step parse config file");
if(!m_context->pluginFilePath.getMetaFile().Exists()){
m_dataFromConfigXML = false;
return;
}
- _D("Plugin Config file::%s", m_context->pluginFilePath.getMetaFile().Fullpath().c_str());
+ LogInfo("Plugin Config file::" << m_context->pluginFilePath.getMetaFile());
Try
{
FOREACH(it, m_pluginInfo.m_featureContainer)
{
- _D("Parsed feature : %ls", it->m_name.c_str());
+ LogDebug("Parsed feature : " << it->m_name);
FOREACH(devCap, it->m_deviceCapabilities) {
- _D(" | DevCap : %ls", (*devCap).c_str());
+ LogDebug(" | DevCap : " << *devCap);
}
}
}
Catch(ValidationCore::ParserSchemaException::Base)
{
- _E("Error during file processing %s", m_context->pluginFilePath.getMetaFile().Fullpath().c_str());
+ LogError("Error during file processing " <<
+ m_context->pluginFilePath.getMetaFile());
ThrowMsg(Exceptions::PluginMetafileFailed,
"Metafile error");
}
if (m_dataFromConfigXML) {
return;
}
- _D("Plugin installation: step find plugin library");
- _D("Plugin .so: %s", m_context->pluginFilePath.getLibraryName().c_str());
+ LogDebug("Plugin installation: step find plugin library");
+ LogDebug("Plugin .so: " << m_context->pluginFilePath.getLibraryName());
m_pluginInfo.m_libraryName = m_context->pluginFilePath.getLibraryName();
}
void PluginInstallTask::stepLoadPluginLibrary()
{
- _D("Plugin installation: step load library");
+ LogDebug("Plugin installation: step load library");
DISABLE_IF_PLUGIN_WITHOUT_LIB()
- _D("Loading plugin: %s", m_context->pluginFilePath.getLibraryName().c_str());
+ LogDebug("Loading plugin: " << m_context->pluginFilePath.getLibraryName());
fprintf(stderr, " - Try to dlopen() : [%s] ", m_context->pluginFilePath.getLibraryPath().Fullpath().c_str());
fprintf(stderr,
"-> Failed!\n %s\n",
(error != NULL ? error : "unknown"));
- _E("Failed to load plugin: %s. Reason: %s", m_context->pluginFilePath.getLibraryName().c_str(), (error != NULL ? error : "unknown"));
+ LogError(
+ "Failed to load plugin: " << m_context->pluginFilePath.getLibraryName() <<
+ ". Reason: " << (error != NULL ? error : "unknown"));
ThrowMsg(Exceptions::PluginLibraryError, "Library error");
}
if (rawEntityList == NULL) {
dlclose(dlHandle);
- _E("Failed to read class name %s", m_context->pluginFilePath.getLibraryName().c_str());
+ LogError("Failed to read class name" << m_context->pluginFilePath.getLibraryName());
ThrowMsg(Exceptions::PluginLibraryError, "Library error");
}
if (NULL == onWidgetInitProc) {
dlclose(dlHandle);
- _E("Failed to read onWidgetInit symbol %s", m_context->pluginFilePath.getLibraryName().c_str());
+ LogError("Failed to read onWidgetInit symbol" << m_context->pluginFilePath.getLibraryName());
ThrowMsg(Exceptions::PluginLibraryError, "Library error");
}
if (!mappingInterface.featGetter || !mappingInterface.release ||
!mappingInterface.dcGetter)
{
- _E("Failed to obtain mapping interface from .so");
+ LogError("Failed to obtain mapping interface from .so");
ThrowMsg(Exceptions::PluginLibraryError, "Library error");
}
feature_mapping_t* devcapMapping = mappingInterface.featGetter();
- _D("Getting mapping from features to device capabilities");
+ LogDebug("Getting mapping from features to device capabilities");
for (size_t i = 0; i < devcapMapping->featuresCount; ++i) {
PluginMetafileData::Feature feature;
feature.m_name = devcapMapping->features[i].feature_name;
- _D("Feature: %s", feature.m_name.c_str());
+ LogDebug("Feature: " << feature.m_name);
const devcaps_t* dc =
mappingInterface.dcGetter(
devcapMapping->features[i].
feature_name);
+ LogDebug("device=cap: " << dc);
+
if (dc) {
- _D("devcaps count: %s", dc->devCapsCount);
+ LogDebug("devcaps count: " << dc->devCapsCount);
for (size_t j = 0; j < dc->devCapsCount; ++j) {
- _D("devcap: %s", dc->deviceCaps[j]);
+ LogDebug("devcap: " << dc->deviceCaps[j]);
feature.m_deviceCapabilities.insert(dc->deviceCaps[j]);
}
}
m_libraryObjects = PluginObjectsPtr(new PluginObjects());
const js_entity_definition_t *rawEntityListIterator = rawEntityList;
- _D("#####");
- _D("##### Plugin: %s supports new plugin API", m_context->pluginFilePath.getLibraryName().c_str());
- _D("#####");
+ LogDebug("#####");
+ LogDebug("##### Plugin: "
+ << m_context->pluginFilePath.getLibraryName()
+ << " supports new plugin API");
+ LogDebug("#####");
while (rawEntityListIterator->parent_name != NULL &&
rawEntityListIterator->object_name != NULL)
{
- _D("##### [%s]: ", rawEntityListIterator->object_name);
- _D("##### Parent: %s", rawEntityListIterator->parent_name);
- _D("#####");
+ LogDebug("##### [" << rawEntityListIterator->object_name << "]: ");
+ LogDebug("##### Parent: " << rawEntityListIterator->parent_name);
+ LogDebug("#####");
m_libraryObjects->addObjects(rawEntityListIterator->parent_name,
rawEntityListIterator->object_name);
// Unload library
if (dlclose(dlHandle) != 0) {
- _E("Cannot close plugin handle");
+ LogError("Cannot close plugin handle");
} else {
- _D("Library is unloaded");
+ LogDebug("Library is unloaded");
}
// Load export table
- _D("Library successfuly loaded and parsed");
+ LogDebug("Library successfuly loaded and parsed");
SET_PLUGIN_INSTALL_PROGRESS(LOADING_LIBRARY, "Library loaded and analyzed");
}
void PluginInstallTask::stepRegisterPlugin()
{
- _D("Plugin installation: step register Plugin");
+ LogDebug("Plugin installation: step register Plugin");
m_pluginHandle =
PluginDAO::registerPlugin(m_pluginInfo, m_context->pluginFilePath.Fullpath());
void PluginInstallTask::stepRegisterFeatures()
{
- _D("Plugin installation: step register features");
+ LogDebug("Plugin installation: step register features");
FOREACH(it, m_pluginInfo.m_featureContainer)
{
- _D("PluginHandle: %s", m_pluginHandle);
+ LogDebug("PluginHandle: " << m_pluginHandle);
FeatureDAO::RegisterFeature(*it, m_pluginHandle);
}
SET_PLUGIN_INSTALL_PROGRESS(REGISTER_FEATURES, "Features registered");
void PluginInstallTask::stepRegisterPluginObjects()
{
- _D("Plugin installation: step register objects");
+ LogDebug("Plugin installation: step register objects");
DISABLE_IF_PLUGIN_WITHOUT_LIB()
FOREACH(it, *objects)
{
if (m_libraryObjects->hasObject(*it)) {
- _D("Dependency from the same library. ignored");
+ LogDebug("Dependency from the same library. ignored");
continue;
}
void PluginInstallTask::stepResolvePluginDependencies()
{
- _D("Plugin installation: step resolve dependencies ");
+ LogDebug("Plugin installation: step resolve dependencies ");
//DISABLE_IF_PLUGIN_WITHOUT_LIB
if (m_pluginInfo.m_libraryName.empty()) {
//Installation completed
m_context->pluginHandle = m_pluginHandle;
m_context->installationCompleted = true;
- _W("Plugin without library.");
+ LogWarning("Plugin without library.");
return;
}
FOREACH(it, *(m_libraryObjects->getDependentObjects()))
{
if (m_libraryObjects->hasObject(*it)) {
- _D("Dependency from the same library. ignored");
+ LogDebug("Dependency from the same library. ignored");
continue;
}
handle = PluginDAO::getPluginHandleForImplementedObject(*it);
if (handle == INVALID_PLUGIN_HANDLE) {
- _E("Library implementing: %s NOT FOUND", (*it).c_str());
+ LogError("Library implementing: " << *it << " NOT FOUND");
PluginDAO::setPluginInstallationStatus(
m_pluginHandle,
PluginDAO::INSTALLATION_WAITING);
* @brief
*/
#include <string>
-#include <installer_log.h>
+#include <dpl/log/log.h>
#include "plugin_objects.h"
namespace {
std::string normalizeName(const std::string& objectName)
{
if (objectName.empty()) {
- _E("Normalize name, name size is 0");
+ LogError("Normalize name, name size is 0");
return objectName;
}
const std::string& parentName)
{
if (objectName.empty() || parentName.empty()) {
- _E("Normalize name, name size or parent name size is 0");
+ LogError("Normalize name, name size or parent name size is 0");
return std::string();
}
*/
#include <ace_registration.h>
+#include <dpl/log/log.h>
#include <dpl/foreach.h>
#include <ace_api_install.h>
-#include <installer_log.h>
-
namespace {
char* toAceString(const DPL::OptionalString& os)
{
const WrtDB::WidgetRegisterInfo& widgetConfig,
const WrtDB::WidgetCertificateDataList& certList)
{
- _D("Updating Ace database");
+ LogDebug("Updating Ace database");
struct widget_info wi;
switch (widgetConfig.webAppType.appType) {
wi.type = Tizen;
break;
default:
- _E("Unknown application type");
+ LogError("Unknown application type");
return false;
}
wi.version = toAceString(widgetConfig.configInfo.version);
wi.author = toAceString(widgetConfig.configInfo.authorName);
wi.shareHerf = strdup(widgetConfig.shareHref.c_str());
- _D("Basic data converted. Certificates begin.");
+ LogDebug("Basic data converted. Certificates begin.");
//one more element for NULL termination
- _D("Found: %d certificates", certList.size());
+ LogDebug("Found: " << certList.size() << " certificates");
ace_certificate_data** certData = new ace_certificate_data *
[certList.size() + 1];
certData[certList.size()] = NULL; // last element set to NULL
certData[i]->owner = DISTRIBUTOR;
break;
default:
- _D("Unknown owner type of cert");
+ LogDebug("Unknown owner type of cert");
certData[i]->owner = UNKNOWN;
break;
}
certData[i]->type = ROOT;
break;
default:
- _E("Unknown type of cert");
+ LogError("Unknown type of cert");
certData[i]->type = ENDENTITY;
break;
}
++i;
}
- _D("Registerign widget in ace");
+ LogDebug("Registerign widget in ace");
ace_return_t retval = ace_register_widget(
static_cast<ace_widget_handle_t>(widgetHandle), &wi, certData);
bool registerAceWidgetFromDB(const WrtDB::DbWidgetHandle& widgetHandle)
{
using namespace WrtDB;
- _D("Updating Ace database from Widget DB");
+ LogDebug("Updating Ace database from Widget DB");
struct widget_info wi;
DPL::OptionalString os;
WrtDB::WidgetCertificateDataList certList;
if (type == WrtDB::APP_TYPE_TIZENWEBAPP) {
wi.type = Tizen;
} else {
- _E("Unknown application type");
+ LogError("Unknown application type");
return false;
}
wi.version = toAceString(dao.getVersion());
wi.author = toAceString(dao.getAuthorName());
wi.shareHerf = strdup(dao.getShareHref().c_str());
- _D("Basic data converted. Certificates begin.");
+ LogDebug("Basic data converted. Certificates begin.");
certList = dao.getCertificateDataList();
}
Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) {
- _E("Widget does not exist");
+ LogError("Widget does not exist");
return false;
}
//one more element for NULL termination
- _D("Found: %d certificates", certList.size());
+ LogDebug("Found: " << certList.size() << " certificates");
ace_certificate_data** certData = new ace_certificate_data *
[certList.size() + 1];
certData[certList.size()] = NULL; // last element set to NULL
certData[i]->owner = DISTRIBUTOR;
break;
default:
- _D("Unknown owner type of cert");
+ LogDebug("Unknown owner type of cert");
certData[i]->owner = UNKNOWN;
break;
}
certData[i]->type = ROOT;
break;
default:
- _E("Unknown type of cert");
+ LogError("Unknown type of cert");
certData[i]->type = ENDENTITY;
break;
}
++i;
}
- _D("Registerign widget in ace");
+ LogDebug("Registerign widget in ace");
ace_return_t retval = ace_register_widget(
static_cast<ace_widget_handle_t>(widgetHandle), &wi, certData);
#include <unistd.h>
#include <dirent.h>
#include <fstream>
+#include <dpl/log/log.h>
#include <dpl/foreach.h>
#include <dpl/utils/wrt_utility.h>
#include <widget_install_to_external.h>
#include <widget_install/widget_unzip.h>
-#include <installer_log.h>
-
using namespace WrtDB;
using namespace Jobs::Exceptions;
void JobWidgetInstall::appendNewInstallationTaskList()
{
- _D("Configure installation succeeded");
+ LogDebug("Configure installation succeeded");
m_installerContext.job->SetProgressFlag(true);
AddTask(new TaskRecovery(m_installerContext));
void JobWidgetInstall::appendUpdateInstallationTaskList()
{
- _D("Configure installation updated");
- _D("Widget Update");
+ LogDebug("Configure installation updated");
+ LogDebug("Widget Update");
m_installerContext.job->SetProgressFlag(true);
if (m_installerContext.mode.command ==
void JobWidgetInstall::appendFailureTaskList()
{
// Installation is not allowed to proceed due to widget update policy
- _W("Configure installation failed!");
+ LogWarning("Configure installation failed!");
GetInstallerStruct().pkgmgrInterface->sendSignal(
PKGMGR_START_KEY,
PKGMGR_START_INSTALL);
PKGMGR_PROGRESS_KEY,
percent.str());
- _D("Call widget install progressCallback");
+ LogPedantic("Call widget install progressCallback");
GetInstallerStruct().progressCallback(
GetInstallerStruct().userParam,
GetProgressPercent(),
PKGMGR_END_KEY,
PKGMGR_END_SUCCESS);
- _D("Call widget install successfinishedCallback");
+ LogDebug("Call widget install successfinishedCallback");
GetInstallerStruct().finishedCallback(GetInstallerStruct().userParam,
DPL::ToUTF8String(
tizenId), Jobs::Exceptions::Success);
// remove widget install information file
unlink(m_installerContext.installInfo.c_str());
- _E("Error number: %d", m_exceptionCaught);
- _E("Message: %s", m_exceptionMessage.c_str());
+ LogError("Error number: " << m_exceptionCaught);
+ LogError("Message: " << m_exceptionMessage);
TizenAppId & tizenId = m_installerContext.widgetConfig.tzAppid;
- _D("Call widget install failure finishedCallback");
+ LogDebug("Call widget install failure finishedCallback");
std::stringstream errorNum;
errorNum << m_exceptionCaught;
out << std::endl;
- _D("%s", out.str().c_str());
+ LogDebug(out.str());
}
} //namespace WidgetInstall
} //namespace Jobs
#include <widget_install/task_ace_check.h>
#include <dpl/assert.h>
+#include <dpl/log/log.h>
#include <dpl/foreach.h>
#include <widget_install/widget_install_context.h>
#include <dpl/wrt-dao-rw/widget_dao.h>
#include <ace_api_install.h>
-#include <installer_log.h>
-
namespace Jobs {
namespace WidgetInstall {
TaskAceCheck::TaskAceCheck(InstallerContext& context) :
void TaskAceCheck::StepAceCheck()
{
WrtDB::WidgetDAO dao(m_context.widgetConfig.tzAppid);
- _D("StepAceCheck!");
+ LogDebug("StepAceCheck!");
// This widget does not use any device cap
if (m_context.featureLogic->isDone()) {
return;
}
- _D("StepAceCheck!");
+ LogDebug("StepAceCheck!");
DPL::String deviceCap = m_context.featureLogic->getDevice();
- _D("StepAceCheck!");
- _D("DevCap is : %ls", deviceCap.c_str());
+ LogDebug("StepAceCheck!");
+ LogDebug("DevCap is : " << deviceCap);
std::string devCapStr = DPL::ToUTF8String(deviceCap);
ace_policy_result_t policyResult = ACE_DENY;
//TODO: remove dao.getHandle()
if (m_context.mode.installTime == InstallMode::InstallTime::PRELOAD) {
- _D("This widget is preloaded. So ace check will be skiped");
+ LogDebug("This widget is preloaded. So ace check will be skiped");
policyResult = ACE_PERMIT;
} else {
ace_return_t ret = ace_get_policy_result(
}
}
- _D("PolicyResult is : %d", static_cast<int>(policyResult));
+ LogDebug("PolicyResult is : " << static_cast<int>(policyResult));
m_context.staticPermittedDevCaps.insert(std::make_pair(deviceCap,
policyResult ==
ACE_PERMIT));
return;
}
- _D("StepProcessAceResponse");
+ LogDebug("StepProcessAceResponse");
m_context.featureLogic->next();
// No device caps left to process
if (m_context.featureLogic->isDone()) {
- _D("All responses has been received from ACE.");
+ LogDebug("All responses has been received from ACE.");
// Data to convert to C API
std::vector<std::string> devCaps;
std::vector<bool> devCapsSmack;
// Saving static dev cap permissions
FOREACH(cap, m_context.staticPermittedDevCaps) {
- _D("staticPermittedDevCaps : %ls smack: %d", cap->first.c_str(), cap->second);
+ LogDebug("staticPermittedDevCaps : " << cap->first
+ << " smack: " << cap->second);
std::string devCapStr = DPL::ToUTF8String(cap->first);
devCaps.push_back(devCapStr);
devCapsSmack.push_back(cap->second);
for (std::set<std::string>::const_iterator iter = acceptedFeature.begin();
iter != acceptedFeature.end(); ++iter)
{
- _D("Accepted feature item: %s", iter->c_str());
+ LogDebug("Accepted feature item: " << iter->c_str());
featureList.items[i] = const_cast<char *>(iter->c_str());
i++;
}
delete[] featureList.items;
if (ACE_OK != ret) {
- _E("Error in ace_set_feature");
+ LogError("Error in ace_set_feature");
ThrowMsg(Exceptions::AceCheckFailed, "Instalation failure. "
"ace_set_feature failure.");
}
return;
}
- _D("Next device cap.");
+ LogDebug("Next device cap.");
// Process next device cap
SwitchToStep(&TaskAceCheck::StepAceCheck);
}
void TaskAceCheck::StepCheckAceResponse()
{
- _D("Checking ACE response");
+ LogDebug("Checking ACE response");
if (m_context.featureLogic->isRejected()) {
- _E("Installation failure. Some devCap was not accepted by ACE.");
+ LogError("Installation failure. Some devCap was not accepted by ACE.");
ThrowMsg(
Exceptions::PrivilegeLevelViolation,
"Instalation failure. "
"Some deviceCap was not accepted by ACE.");
}
- _D("Updating \"feature reject status\" in database!");
+ LogDebug("Updating \"feature reject status\" in database!");
auto it = m_context.featureLogic->resultBegin();
auto end = m_context.featureLogic->resultEnd();
for (; it != end; ++it) {
- _D(" |- Feature: %ls has reject status: %d", it->name.c_str(), it->rejected);
+ LogDebug(
+ " |- Feature: " << it->name << " has reject status: " <<
+ it->rejected);
if (it->rejected) {
WrtDB::WidgetDAO dao(m_context.widgetConfig.tzAppid);
dao.updateFeatureRejectStatus(*it);
}
}
- _D("Installation continues...");
+ LogDebug("Installation continues...");
}
void TaskAceCheck::StartStep()
{
- _D("--------- <TaskAceCheck> : START ----------");
+ LogDebug("--------- <TaskAceCheck> : START ----------");
}
void TaskAceCheck::EndStep()
InstallerContext::INSTALL_ACE_CHECK,
"Widget Access Control Check Finished");
- _D("--------- <TaskAceCheck> : END ----------");
+ LogDebug("--------- <TaskAceCheck> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
#include <widget_install/job_widget_install.h>
#include <widget_install/widget_install_errors.h>
#include <widget_install/widget_install_context.h>
+#include <dpl/log/log.h>
#include <dpl/wrt-dao-ro/global_config.h>
#include "wac_widget_id.h"
#include <ITapiModem.h>
#include <tapi_common.h>
-#include <installer_log.h>
-
using namespace ValidationCore;
using namespace WrtDB;
WidgetCertificateData result;
result.chainId = data.getSignatureNumber();
- _D("result.chainId : %d", result.chainId);
+ LogDebug("result.chainId : " << result.chainId);
result.owner = data.isAuthorSignature() ?
WidgetCertificateData::AUTHOR : WidgetCertificateData::DISTRIBUTOR;
{
ValidationCore::CertificateCollection chain;
if (false == chain.load(*it)) {
- _E("Chain is broken");
+ LogError("Chain is broken");
}
if (!chain.sort()) {
- _E("Chain failed at sorting");
+ LogError("Chain failed at sorting");
}
ValidationCore::CertificateList list = chain.getCertificateList();
void TaskCertify::processAuthorSignature(const SignatureData &data)
{
using namespace ValidationCore;
- _D("DNS Identity match!");
+ LogDebug("DNS Identity match!");
// this signature is verified or widget is distributor signed
m_contextData.widgetSecurity.setAuthorCertificatePtr(data.getEndEntityCertificatePtr());
CertificatePtr test = m_contextData.widgetSecurity.getAuthorCertificatePtr();
void TaskCertify::getSignatureFiles(std::string path, SignatureFileInfoSet& file)
{
- _D("path : %s", path.c_str());
+ LogDebug("path : " << path);
SignatureFileInfoSet signatureFiles;
SignatureFinder signatureFinder(path);
if (SignatureFinder::NO_ERROR != signatureFinder.find(file)) {
- _E("Error in Signature Finder : %s", path.c_str());
+ LogError("Error in Signature Finder : " << path);
ThrowMsg(Exceptions::SignatureNotFound,
"Error openig temporary widget directory");
}
void TaskCertify::stepSignature()
{
- _D("================ Step: <<Signature>> ENTER ===============");
+ LogDebug("================ Step: <<Signature>> ENTER ===============");
std::string widgetPath;
widgetPath = m_contextData.locations->getTemporaryPackageDir() + "/";
}
SignatureFileInfoSet::reverse_iterator iter = signatureFiles.rbegin();
- _D("Number of signatures: %d", signatureFiles.size());
+ LogDebug("Number of signatures: " << signatureFiles.size());
for (; iter != signatureFiles.rend(); ++iter) {
- _D("Checking signature with id=%d", iter->getFileNumber());
+ LogDebug("Checking signature with id=" << iter->getFileNumber());
SignatureData data(widgetPath + iter->getFileName(),
iter->getFileNumber());
}
if (result == WrtSignatureValidator::SIGNATURE_REVOKED) {
- _W("Certificate is REVOKED");
+ LogWarning("Certificate is REVOKED");
ThrowMsg(Exceptions::CertificateExpired,
"Certificate is REVOKED");
}
if (result == WrtSignatureValidator::SIGNATURE_INVALID &&
iter->getFileNumber() <= 1) {
- _W("Signature is INVALID");
+ LogWarning("Signature is INVALID");
// TODO change exception name
ThrowMsg(Exceptions::SignatureInvalid,
"Invalid Package");
}
}
} Catch(ParserSchemaException::Base) {
- _E("Error occured in ParserSchema.");
+ LogError("Error occured in ParserSchema.");
ReThrowMsg(Exceptions::SignatureInvalid,
"Error occured in ParserSchema.");
}
}
if (signatureFiles.empty()) {
- _D("No signature files has been found.");
+ LogDebug("No signature files has been found.");
}
- _D("================ Step: <<Signature>> DONE ================");
+ LogDebug("================ Step: <<Signature>> DONE ================");
m_contextData.job->UpdateProgress(
InstallerContext::INSTALL_DIGSIG_CHECK,
void TaskCertify::stepVerifyUpdate()
{
- _D("Step: <<Check Update>>");
+ LogDebug("Step: <<Check Update>>");
CertificatePtr newCertificate =
m_contextData.widgetSecurity.getAuthorCertificatePtr();
CertificatePtr oldCertificate =
if (!!newCertificate && !!oldCertificate) {
if (0 != newCertificate->getBase64().compare(oldCertificate->getBase64())) {
- _D("old widget's author signer certificate : %ls", oldCertificate->getBase64().c_str());
- _D("new widget's author signer certificate : %ls", newCertificate->getBase64().c_str());
+ LogDebug("old widget's author signer certificate : " <<
+ oldCertificate->getBase64());
+ LogDebug("new widget's author signer certificate : " <<
+ newCertificate->getBase64());
ThrowMsg(Exceptions::NotMatchedCertification,
"Author signer certificates doesn't match \
between old widget and installing widget");
void TaskCertify::StartStep()
{
- _D("--------- <TaskCertify> : START ----------");
+ LogDebug("--------- <TaskCertify> : START ----------");
}
void TaskCertify::EndStep()
{
- _D("Step: <<CERTYFYING DONE>>");
+ LogDebug("Step: <<CERTYFYING DONE>>");
m_contextData.job->UpdateProgress(
InstallerContext::INSTALL_CERT_CHECK,
"Widget Certification Check Finished");
- _D("--------- <TaskCertify> : END ----------");
+ LogDebug("--------- <TaskCertify> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
#include <widget_install/widget_install_errors.h>
#include <widget_install/widget_install_context.h>
#include <dpl/assert.h>
+#include <dpl/log/log.h>
#include <dpl/exception.h>
#include <dpl/string.h>
#include <dpl/foreach.h>
#include <dpl/utils/wrt_global_settings.h>
#include <dpl/wrt-dao-ro/global_dao_read_only.h>
-#include <installer_log.h>
-
using namespace ValidationCore;
using namespace WrtDB;
void TaskCertifyLevel::stepCertifyLevel()
{
- _D("================ Step: <<Certify Level>> ENTER ===============");
+ LogDebug("================ Step: <<Certify Level>> ENTER ===============");
if (!checkConfigurationLevel(getCertifyLevel())) {
ThrowMsg(Exceptions::PrivilegeLevelViolation, "setting level violate");
}
- _D("================ Step: <<Certify Level>> DONE ================");
+ LogDebug("================ Step: <<Certify Level>> DONE ================");
}
void TaskCertifyLevel::getSignatureFiles(const std::string& path,
SignatureFileInfoSet signatureFiles;
SignatureFinder signatureFinder(path);
if (SignatureFinder::NO_ERROR != signatureFinder.find(file)) {
- _E("Error in Signature Finder : %s", path.c_str());
+ LogError("Error in Signature Finder : " << path);
ThrowMsg(Exceptions::SignatureNotFound, "Signature not found");
}
}
}
SignatureFileInfoSet::reverse_iterator iter = signatureFiles.rbegin();
- _D("Number of signatures: %d", signatureFiles.size());
+ LogDebug("Number of signatures: " << signatureFiles.size());
Level level = Level::UNKNOWN;
for (; iter != signatureFiles.rend(); ++iter) {
- _D("Checking signature with id=%d", iter->getFileNumber());
+ LogDebug("Checking signature with id=" << iter->getFileNumber());
SignatureData data(widgetPath + iter->getFileName(),
iter->getFileNumber());
}
if (data.isAuthorSignature()) {
- _D("Skip author signature");
+ LogDebug("Skip author signature");
} else {
Level currentCertLevel =
certTypeToLevel(data.getVisibilityLevel());
}
if (currentCertLevel > level) {
level = currentCertLevel;
- _D("level %s", enumToString(level).c_str());
+ LogDebug("level " << enumToString(level));
}
}
} Catch(ParserSchemaException::Base) {
- _E("Error occured in ParserSchema.");
+ LogError("Error occured in ParserSchema.");
ReThrowMsg(Exceptions::SignatureInvalid,
"Error occured in ParserSchema.");
}
secureSettingIter ret = data.find(DPL::ToUTF8String(it->m_name));
if (ret != data.end()) {
if (level < ret->second) {
- _E("\"%s\" needs \"%s\" level", it->m_name.c_str(), enumToString(ret->second).c_str());
+ LogError("\"" <<
+ it->m_name <<
+ "\" needs \"" <<
+ enumToString(ret->second) <<
+ "\" level");
return false;
}
}
it->m_disposition)
{
if (level < Level::PLATFORM) {
- _E("\"tizen:disposition\" needs \"%s \" level", enumToString(Level::PLATFORM).c_str());
+ LogError("\"tizen:disposition\" needs \"" <<
+ enumToString(Level::PLATFORM) <<
+ "\" level");
return false;
}
}
void TaskCertifyLevel::StartStep()
{
- _D("--------- <TaskCertifyLevel> : START ----------");
+ LogDebug("--------- <TaskCertifyLevel> : START ----------");
}
void TaskCertifyLevel::EndStep()
{
- _D("--------- <TaskCertifyLevel> : END ----------");
+ LogDebug("--------- <TaskCertifyLevel> : END ----------");
m_contextData.job->UpdateProgress(
InstallerContext::INSTALL_CERTIFY_LEVEL_CHECK,
#include <sys/stat.h>
#include <sys/time.h>
#include <dpl/wrt-dao-ro/global_config.h>
+#include <dpl/log/log.h>
#include <dpl/exception.h>
#include <dpl/errno_string.h>
#include <dpl/utils/wrt_utility.h>
#include <widget_install/widget_install_errors.h>
-#include <installer_log.h>
namespace Jobs {
namespace WidgetInstall {
std::string createTempPath(bool preload)
{
- _D("Step: Creating temporary path");
+ LogDebug("Step: Creating temporary path");
// Temporary path
std::ostringstream tempPathBuilder;
#include <widget_install/job_widget_install.h>
#include <widget_install/task_commons.h>
-#include <installer_log.h>
-
using namespace WrtDB;
namespace {
bool hasExtension(const std::string& filename, const std::string& extension)
{
- _D("Looking for extension %s in %s", extension.c_str(), filename.c_str());
+ LogDebug("Looking for extension " << extension << " in: " << filename);
size_t fileLen = filename.length();
size_t extLen = extension.length();
if (fileLen < extLen) {
- _E("Filename %s is shorter than extension %s", filename.c_str(), extension.c_str());
+ LogError("Filename " << filename << " is shorter than extension "
+ << extension);
return false;
}
return (0 == filename.compare(fileLen - extLen, extLen, extension));
void TaskConfiguration::StartStep()
{
- _D("--------- <TaskConfiguration> : START ----------");
+ LogDebug("--------- <TaskConfiguration> : START ----------");
}
void TaskConfiguration::EndStep()
{
- _D("--------- <TaskConfiguration> : END ----------");
+ LogDebug("--------- <TaskConfiguration> : END ----------");
}
void TaskConfiguration::AppendTasklistStep()
m_context.confResult = m_result;
if (m_result == ConfigureResult::Ok) {
- _D("TaskConfiguration -> new installation task list");
+ LogInfo("TaskConfiguration -> new installation task list");
m_context.job->appendNewInstallationTaskList();
} else if (m_result == ConfigureResult::Updated) {
- _D("TaskConfiguration -> update installation task list");
+ LogInfo("TaskConfiguration -> update installation task list");
m_context.job->appendUpdateInstallationTaskList();
} else {
- _D("TaskConfiguration -> failure task list");
+ LogInfo("TaskConfiguration -> failure task list");
m_context.job->appendFailureTaskList();
}
}
wgtUnzip.unzipWgtFile(widgetPath, tempDir);
}
- _D("widgetPath:%s", widgetPath.c_str());
- _D("tempPath:%s", tempDir.c_str());
+ LogDebug("widgetPath:" << widgetPath);
+ LogDebug("tempPath:" << tempDir);
m_context.widgetConfig.packagingType =
checkPackageType(widgetPath, tempDir);
tempDir,
m_context.widgetConfig.packagingType,
m_context.mode.command == InstallMode::Command::REINSTALL);
- _D("widget packaging type : %d", m_context.widgetConfig.packagingType.pkgType);
+ LogDebug("widget packaging type : " <<
+ m_context.widgetConfig.packagingType.pkgType);
setTizenId(configData);
setApplicationType(configData);
// TODO: (job_install_refactoring) hide this call
m_context.callerPkgId =
DPL::FromUTF8String(m_context.job->GetInstallerStruct().pkgmgrInterface->getCallerId());
- _D("Caller Package Id : %s", m_context.callerPkgId.c_str());
+ LogDebug("Caller Package Id : " << m_context.callerPkgId);
// Configure installation
result = ConfigureInstallation(widgetPath, configData, tempDir);
}
Catch(Exceptions::OpenZipFailed)
{
- _E("Failed to unzip for widget");
+ LogError("Failed to unzip for widget");
result = ConfigureResult::Failed_OpenZipError;
}
Catch(Exceptions::ExtractFileFailed)
{
- _E("Failed to unzip for widget");
+ LogError("Failed to unzip for widget");
result = ConfigureResult::Failed_UnzipError;
}
Catch(Exceptions::DrmDecryptFailed)
{
- _E("Failed to unzip for widget");
+ LogError("Failed to unzip for widget");
result = ConfigureResult::Failed_DrmError;
}
Catch(Exceptions::MissingConfig)
{
- _E("Failed to localize config.xml");
+ LogError("Failed to localize config.xml");
result = ConfigureResult::Failed_InvalidConfig;
}
Catch(Exceptions::WidgetConfigFileInvalid)
{
- _E("Invalid configuration file");
+ LogError("Invalid configuration file");
result = ConfigureResult::Failed_InvalidConfig;
}
Catch(DPL::Exception)
{
- _E("Unknown exception");
+ LogError("Unknown exception");
result = ConfigureResult::Failed;
}
bool shouldMakeAppid = false;
using namespace PackageManager;
if (!!configInfo.tizenAppId) {
- _D("Setting tizenAppId provided in config.xml: %ls", (*configInfo.tizenAppId).c_str());
+ LogDebug("Setting tizenAppId provided in config.xml: " <<
+ configInfo.tizenAppId);
+
m_context.widgetConfig.tzAppid = *configInfo.tizenAppId;
//check package id.
if (!!configInfo.tizenPkgId) {
- _D("Setting tizenPkgId provided in config.xml: %ls", (*configInfo.tizenPkgId).c_str());
+ LogDebug("Setting tizenPkgId provided in config.xml: " <<
+ configInfo.tizenPkgId);
+
m_context.widgetConfig.tzPkgid = *configInfo.tizenPkgId;
} else {
DPL::String appid = *configInfo.tizenAppId;
} else {
shouldMakeAppid = true;
TizenPkgId pkgId = WidgetDAOReadOnly::generatePkgId();
- _D("Checking if pkg id is unique");
+ LogDebug("Checking if pkg id is unique");
while (true) {
if (!validateTizenPackageID(pkgId)) {
//path exist, chose another one
break;
}
m_context.widgetConfig.tzPkgid = pkgId;
- _D("tizen_id name was generated by WRT: %s", m_context.widgetConfig.tzPkgid.c_str());
+ LogDebug("tizen_id name was generated by WRT: " <<
+ m_context.widgetConfig.tzPkgid);
}
if (shouldMakeAppid == true) {
}
regex_t regx;
if (regcomp(®x, REG_NAME_PATTERN, REG_NOSUB | REG_EXTENDED) != 0) {
- _D("Regcomp failed");
+ LogDebug("Regcomp failed");
}
- _D("Name : %ls", (*name).c_str());
+ LogDebug("Name : " << name);
if (!name || (regexec(®x, DPL::ToUTF8String(*name).c_str(),
static_cast<size_t>(0), NULL, 0) != REG_NOERROR))
{
genName << "_" << allowedString[rand_r(&seed) % allowedString.length()];
name = DPL::FromUTF8String(genName.str());
- _D("name was generated by WRT");
+ LogDebug("name was generated by WRT");
}
regfree(®x);
- _D("Name : %ls", (*name).c_str());
+ LogDebug("Name : " << name);
std::ostringstream genid;
genid << m_context.widgetConfig.tzPkgid << "." << name;
- _D("tizen appid was generated by WRT : %s", genid.str().c_str());
+ LogDebug("tizen appid was generated by WRT : " << genid.str());
DPL::OptionalString appid = DPL::FromUTF8String(genid.str());
NormalizeAndTrimSpaceString(appid);
m_context.
widgetConfig.
tzPkgid));
- _D("Tizen App Id : %ls", (m_context.widgetConfig.tzAppid).c_str());
- _D("Tizen Pkg Id : %ls", (m_context.widgetConfig.tzPkgid).c_str());
- _D("W3C Widget GUID : %ls", (*m_context.widgetConfig.guid).c_str());
-
+ LogDebug("Tizen App Id : " << m_context.widgetConfig.tzAppid);
+ LogDebug("Tizen Pkg Id : " << m_context.widgetConfig.tzPkgid);
+ LogDebug("W3C Widget GUID : " << m_context.widgetConfig.guid);
}
void TaskConfiguration::configureWidgetLocation(const std::string & widgetPath,
m_context.locations->registerAppid(
DPL::ToUTF8String(m_context.widgetConfig.tzAppid));
- _D("widgetSource %s", widgetPath.c_str());
+ LogDebug("widgetSource " << widgetPath);
}
ConfigureResult TaskConfiguration::ConfigureInstallation(
if (!validateTizenApplicationID(
m_context.widgetConfig.tzAppid))
{
- _E("tizen application ID is already used");
+ LogError("tizen application ID is already used");
return ConfigureResult::Failed_InvalidConfig;
}
if (!validateTizenPackageID(m_context.widgetConfig.tzPkgid)) {
- _E("tizen package ID is already used");
+ LogError("tizen package ID is already used");
return ConfigureResult::Failed_AlreadyInstalled;
}
}
bool TaskConfiguration::validateTizenApplicationID(
const WrtDB::TizenAppId &tizenAppId)
{
- _D("tizen application ID = [%ls]", tizenAppId.c_str());
+ LogDebug("tizen application ID = [" << tizenAppId << "]");
regex_t reg;
if (regcomp(®, REG_TIZENID_PATTERN, REG_NOSUB | REG_EXTENDED) != 0) {
- _D("Regcomp failed");
+ LogDebug("Regcomp failed");
}
if (regexec(®, DPL::ToUTF8String(tizenAppId).c_str(), 0, NULL, 0)
return ConfigureResult::Failed;
}
- _D("existing version = '%ls", update.existingVersion->Raw().c_str());
- _D("incoming version = '%ls", update.incomingVersion->Raw().c_str());
- _D("Tizen AppID = %ls", update.tzAppId.c_str());
+ LogDebug("existing version = '" << update.existingVersion);
+ LogDebug("incoming version = '" << update.incomingVersion);
+ LogDebug("Tizen AppID = " << update.tzAppId);
// Check running state
bool isRunning = false;
app_manager_is_running(DPL::ToUTF8String(update.tzAppId).c_str(),
&isRunning);
if (APP_MANAGER_ERROR_NONE != ret) {
- _E("Fail to get running state");
+ LogError("Fail to get running state");
return ConfigureResult::Failed_WidgetRunning;
}
DPL::ToUTF8String(update.tzAppId).c_str(),
&appCtx);
if (APP_MANAGER_ERROR_NONE != ret) {
- _E("Fail to get app_context");
+ LogError("Fail to get app_context");
return ConfigureResult::Failed_WidgetRunning;
}
// terminate app_context_h
ret = app_manager_terminate_app(appCtx);
if (APP_MANAGER_ERROR_NONE != ret) {
- _E("Fail to terminate running application");
+ LogError("Fail to terminate running application");
app_context_destroy(appCtx);
return ConfigureResult::Failed_WidgetRunning;
} else {
DPL::ToUTF8String(update.tzAppId).c_str(),
&isStillRunning);
if (APP_MANAGER_ERROR_NONE != ret) {
- _E("Fail to get running state");
+ LogError("Fail to get running state");
return ConfigureResult::Failed_WidgetRunning;
}
if (!isStillRunning) {
}
}
if (isStillRunning) {
- _E("Fail to terminate running application");
+ LogError("Fail to terminate running application");
return ConfigureResult::Failed_WidgetRunning;
}
- _D("terminate application");
+ LogDebug("terminate application");
}
}
}
Catch(ElementParser::Exception::ParseError)
{
- _E("Failed to parse config.xml file");
+ LogError("Failed to parse config.xml file");
return ConfigParserData();
}
Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
{
- _E("Failed to find installed widget - give proper tizenId");
+ LogError("Failed to find installed widget - give proper tizenId");
return ConfigParserData();
}
Catch(Exceptions::WidgetConfigFileNotFound){
- _E("Failed to find config.xml");
+ LogError("Failed to find config.xml");
return ConfigParserData();
}
const ConfigParserData &configInfo,
const WrtDB::TizenAppId &tizenId)
{
- _D("Checking up widget package for config.xml...");
+ LogDebug("Checking up widget package for config.xml...");
OptionalWidgetVersion incomingVersion;
if (!configInfo.version.IsNull()) {
const std::string &tempPath)
{
if (hasExtension(widgetSource, XML_EXTENSION)) {
- _D("Hosted app installation");
+ LogDebug("Hosted app installation");
return PKG_TYPE_HOSTED_WEB_APP;
}
{
AppType widgetAppType = APP_TYPE_UNKNOWN;
FOREACH(iterator, configInfo.nameSpaces) {
- _D("namespace = [%ls]", (*iterator).c_str());
+ LogDebug("namespace = [" << *iterator << "]");
if (*iterator == ConfigurationNamespace::TizenWebAppNamespaceName) {
if (widgetAppType != APP_TYPE_UNKNOWN &&
widgetAppType != APP_TYPE_TIZENWEBAPP)
{
- _E("To many namespaces declared in configuration fileA.");
+ LogError("To many namespaces declared in configuration fileA.");
ThrowMsg(Exceptions::WidgetConfigFileInvalid,
"Config.xml has more than one valid namespace");
}
widgetAppType = APP_TYPE_TIZENWEBAPP;
} else {
- _D("Namespace ignored.");
+ LogDebug("Namespace ignored.");
}
}
m_context.widgetConfig.webAppType = widgetAppType;
- _D("type = [%s]", m_context.widgetConfig.webAppType.getApptypeToString().c_str());
+ LogDebug("type = [" <<
+ m_context.widgetConfig.webAppType.getApptypeToString() <<
+ "]");
}
bool TaskConfiguration::detectResourceEncryption(
if (it->m_name == SETTING_VALUE_ENCRYPTION &&
it->m_value == SETTING_VALUE_ENCRYPTION_ENABLE)
{
- _D("resource need encryption");
+ LogDebug("resource need encryption");
return true;
}
}
it->m_value ==
SETTING_VALUE_INSTALLTOEXT_PREPER_EXT)
{
- _D("This widget will be installed to sd card");
+ LogDebug("This widget will be installed to sd card");
m_context.locationType =
INSTALL_LOCATION_TYPE_EXTERNAL;
}
}
}
if (configValue != dbValue) {
- _E("Not Support RDS mode because of encryption setting");
+ LogError("Not Support RDS mode because of encryption setting");
return false;
}
}
#include <dpl/wrt-dao-rw/widget_dao.h>
#include <dpl/foreach.h>
#include <dpl/utils/wrt_utility.h>
+#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <wrt-commons/security-origin-dao/security_origin_dao.h>
#include <wrt-commons/widget-interface-dao/widget_interface_dao.h>
#include <errno.h>
#include <string.h>
#include <map>
-#include <installer_log.h>
using namespace WrtDB;
time(&m_context.widgetConfig.installedTime);
if (m_context.isUpdateMode) { //update
- _D("Registering widget... (update)");
+ LogDebug("Registering widget... (update)");
Try
{
m_handleToRemove = WidgetDAOReadOnly::getHandle(
}
Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
{
- _E(
+ LogError(
"Given tizenId not found for update installation (Same GUID?)");
ThrowMsg(Exceptions::DatabaseFailure,
"Given tizenId not found for update installation");
m_handle =
WidgetDAOReadOnly::getHandle(m_context.widgetConfig.tzAppid);
} else { //new installation
- _D("Registering widget...");
+ LogDebug("Registering widget...");
WidgetDAO::registerWidget(
m_context.widgetConfig.tzAppid,
m_context.widgetConfig,
}
FOREACH(cap, m_context.staticPermittedDevCaps) {
- _D("staticPermittedDevCaps : %ls smack status: %d", cap->first.c_str(), cap->second);
+ LogDebug(
+ "staticPermittedDevCaps : " << cap->first
+ << " smack status: " <<
+ cap->second);
}
- _D("Widget registered");
+ LogDebug("Widget registered");
}
Catch(WidgetDAO::Exception::DatabaseError)
{
- _E("Database failure!");
+ LogError("Database failure!");
ReThrowMsg(Exceptions::InsertNewWidgetFailed, "Database failure!");
}
Catch(DPL::DB::SqlConnection::Exception::Base)
{
- _E("Database failure!");
+ LogError("Database failure!");
ReThrowMsg(Exceptions::InsertNewWidgetFailed, "Database failure!");
}
}
void TaskDatabase::StepAceDBInsert()
{
- _D("Inserting Ace database entry. New handle: %d", m_handle);
+ LogDebug("Inserting Ace database entry. New handle: " << m_handle);
if (INVALID_WIDGET_HANDLE != m_handleToRemove) {
- _D("Removing old insallation. Handle: %d", m_handleToRemove);
+ LogDebug("Removing old insallation. Handle: " << m_handleToRemove);
if (ACE_OK != ace_unregister_widget(
static_cast<ace_widget_handle_t>(m_handleToRemove)))
{
- _W(
+ LogWarning(
"Error while removing ace entry for previous insallation");
}
}
if (!AceApi::registerAceWidget(m_handle, m_context.widgetConfig,
m_context.widgetSecurity.getCertificateList()))
{
- _E("ace database insert failed");
+ LogError("ace database insert failed");
ThrowMsg(Exceptions::UpdateFailed,
"Update failure. ace_register_widget failed");
}
- _D("Ace data inserted");
+ LogDebug("Ace data inserted");
}
void TaskDatabase::StepSecurityOriginDBInsert()
{
- _D("Create Security origin database");
+ LogDebug("Create Security origin database");
// automatically create security origin database
using namespace SecurityOriginDB;
using namespace WrtDB;
void TaskDatabase::StepWidgetInterfaceDBInsert()
{
- _D("Create Widget Interface database");
+ LogDebug("Create Widget Interface database");
using namespace WidgetInterfaceDB;
using namespace WrtDB;
std::string dbPath = WidgetInterfaceDAO::databaseFileName(handle);
std::string backupDbPath = dbPath;
backupDbPath += GlobalConfig::GetBackupDatabaseSuffix();
- _D("\"%s\" to \"%s\"", dbPath.c_str(), backupDbPath.c_str());
+ LogDebug("\"" << dbPath << "\" to \"" << backupDbPath << "\"");
if (0 != std::rename(dbPath.c_str(), backupDbPath.c_str())) {
- _E("widget interface database backup failed");
+ LogError("widget interface database backup failed");
ThrowMsg(Exceptions::UpdateFailed,
"widget interface database backup failed");
}
}
Catch(WidgetInterfaceDAO::Exception::DatabaseError)
{
- _E("widget interface database create failed");
+ LogError("widget interface database create failed");
ThrowMsg(Exceptions::UpdateFailed,
"widget interface database create failed");
}
}
Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
{
- _E(
+ LogError(
"Given tizenId not found for update installation (Same GUID?)");
ThrowMsg(Exceptions::UpdateFailed,
"Given tizenId not found for update installation");
}
}
- _D("Registering external files:");
+ LogDebug("Registering external files:");
FOREACH(file, externalLocationsUpdate)
{
- _D(" -> %ls", (*file).c_str());
+ LogDebug(" -> " << *file);
}
//set external locations to be registered
void TaskDatabase::StepRemoveExternalFiles()
{
if (!m_externalLocationsToRemove.empty()) {
- _D("Removing external files:");
+ LogDebug("Removing external files:");
}
FOREACH(file, m_externalLocationsToRemove)
{
if (WrtUtilFileExists(*file)) {
- _D(" -> %ls", (*file).c_str());
+ LogDebug(" -> " << *file);
if (-1 == TEMP_FAILURE_RETRY(remove(file->c_str()))) {
ThrowMsg(Exceptions::RemovingFileFailure,
"Failed to remove external file");
}
} else if (WrtUtilDirExists(*file)) {
- _D(" -> %ls", (*file).c_str());
+ LogDebug(" -> " << *file);
if (!WrtUtilRemove(*file)) {
ThrowMsg(Exceptions::RemovingFolderFailure,
"Failed to remove external directory");
}
} else {
- _W(" -> %ls(no such a path)", (*file).c_str());
+ LogWarning(" -> " << *file << "(no such a path)");
}
}
}
void TaskDatabase::StepAbortDBInsert()
{
- _W("[DB Update Task] Aborting... (DB Clean)");
+ LogWarning("[DB Update Task] Aborting... (DB Clean)");
Try
{
if (m_context.isUpdateMode) {
} else {
WidgetDAO::unregisterWidget(m_context.widgetConfig.tzAppid);
}
- _D("Cleaning DB successful!");
+ LogDebug("Cleaning DB successful!");
}
Catch(DPL::DB::SqlConnection::Exception::Base)
{
- _E("Failed to handle StepAbortDBClean!");
+ LogError("Failed to handle StepAbortDBClean!");
}
}
void TaskDatabase::StepAbortAceDBInsert()
{
- _W("[DB Update Task] ACE DB Aborting... (DB Clean)");
+ LogWarning("[DB Update Task] ACE DB Aborting... (DB Clean)");
ace_unregister_widget(static_cast<ace_widget_handle_t>(m_handle));
// Remove also old one. If it was already updated nothing wrong will happen,
if (!AceApi::registerAceWidgetFromDB(m_handleToRemove))
{
- _E("ace database restore failed");
+ LogError("ace database restore failed");
}
- _D("Ace data inserted");
+ LogDebug("Ace data inserted");
}
void TaskDatabase::StepAbortWidgetInterfaceDBInsert()
{
- _D("[DB Update Task] Widget interface Aborting...");
+ LogDebug("[DB Update Task] Widget interface Aborting...");
using namespace WidgetInterfaceDB;
using namespace WrtDB;
// remove database
if (remove(dbPath.c_str()) != 0) {
- _W("Fail to remove");
+ LogWarning("Fail to remove");
}
// rollback database
if (m_context.isUpdateMode) {
std::string backupDbPath = dbPath;
backupDbPath += GlobalConfig::GetBackupDatabaseSuffix();
- _D("\"%s\" to \"%s\"", dbPath.c_str(), backupDbPath.c_str());
+ LogDebug("\"" << dbPath << "\" to \"" << backupDbPath << "\"");
if (0 != std::rename(backupDbPath.c_str(), dbPath.c_str())) {
- _W("Fail to rollback");
+ LogWarning("Fail to rollback");
}
}
}
} else {
boxType = DPL::ToUTF8String((**it).m_type);
}
- _D("livebox id: %s", boxId.c_str());
- _D("livebox type: %s", boxType.c_str());
+ LogDebug("livebox id: " << boxId);
+ LogDebug("livebox type: " << boxType);
int autoLaunch = (**it).m_autoLaunch == L"true" ? 1 : 0;
- _D("livebox auto-launch: %d", autoLaunch);
+ LogDebug("livebox auto-launch: " << autoLaunch);
int mouseEvent = (**it).m_boxInfo.m_boxMouseEvent == L"true" ? 1 : 0;
- _D("livebox mouse-event: %d", mouseEvent);
+ LogDebug("livebox mouse-event: " << mouseEvent);
int pdFastOpen = (**it).m_boxInfo.m_pdFastOpen == L"true" ? 1 : 0;
- _D("livebox pd fast-open: %d", pdFastOpen);
+ LogDebug("livebox pd fast-open: " << pdFastOpen);
web_provider_livebox_insert_box_info(
boxId.c_str(), tizenId.c_str(), boxType.c_str(),
void TaskDatabase::StartStep()
{
- _D("--------- <TaskDatabase> : START ----------");
+ LogDebug("--------- <TaskDatabase> : START ----------");
}
void TaskDatabase::EndStep()
{
- _D("--------- <TaskDatabase> : END ----------");
+ LogDebug("--------- <TaskDatabase> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
#include <memory>
+#include <dpl/log/log.h>
#include <dpl/errno_string.h>
#include <dpl/foreach.h>
#include <dpl/scoped_fclose.h>
#include <widget_install/widget_install_context.h>
#include <widget_install/widget_install_errors.h>
-#include <installer_log.h>
-
using namespace WrtDB;
namespace {
void TaskEncryptResource::StepEncryptResource()
{
- _D("Step Encrypt resource");
+ LogDebug("Step Encrypt resource");
EncryptDirectory(m_context.locations->getTemporaryRootDir());
}
if ((fts = fts_open(paths, FTS_PHYSICAL | FTS_NOCHDIR, NULL)) == NULL) {
//ERROR
int error = errno;
- _W("%s: fts_open failed with error: %s", __PRETTY_FUNCTION__, strerror(error));
+ LogWarning(__PRETTY_FUNCTION__ << ": fts_open failed with error: "
+ << strerror(error));
ThrowMsg(Exceptions::EncryptionFailed, "Error reading directory: "
<< path);
}
case FTS_DNR:
case FTS_ERR:
default:
- _W("%s: traversal failed on file: %s with error: %s", __PRETTY_FUNCTION__, ftsent->fts_path, strerror(ftsent->fts_errno));
+ LogWarning(__PRETTY_FUNCTION__
+ << ": traversal failed on file: "
+ << ftsent->fts_path
+ << " with error: "
+ << strerror(ftsent->fts_errno));
ThrowMsg(Exceptions::EncryptionFailed, "Error reading file");
break;
}
if (fts_close(fts) == -1) {
int error = errno;
- _W("%s: fts_close failed with error: %s", __PRETTY_FUNCTION__, strerror(error));
+ LogWarning(__PRETTY_FUNCTION__ << ": fts_close failed with error: "
+ << strerror(error));
}
}
void TaskEncryptResource::EncryptFile(const std::string &fileName)
{
- _D("Encrypt file: %s", fileName.c_str());
+ LogDebug("Encrypt file: " << fileName);
std::string encFile = fileName + ".enc";
struct stat info;
}
const std::size_t fileSize = info.st_size;
if (0 == fileSize) {
- _D("%s size is 0, so encryption is skiped", fileName.c_str());
+ LogDebug(fileName << " size is 0, so encryption is skiped");
return;
}
outFile.Reset();
inFile.Reset();
- _D("File encrypted successfully");
- _D("Remove plain-text file: %s", fileName.c_str());
+ LogDebug("File encrypted successfully");
+ LogDebug("Remove plain-text file: " << fileName);
if (0 != unlink(fileName.c_str()))
{
Throw(Exceptions::EncryptionFailed);
}
- _D("Rename encrypted file");
+ LogDebug("Rename encrypted file");
if (0 != std::rename(encFile.c_str(), fileName.c_str()))
{
Throw(Exceptions::EncryptionFailed);
void TaskEncryptResource::StartStep()
{
- _D("--------- <TaskEncryptResource> : START ----------");
+ LogDebug("--------- <TaskEncryptResource> : START ----------");
}
void TaskEncryptResource::EndStep()
InstallerContext::INSTALL_ECRYPTION_FILES,
"Ecrypt resource files");
- _D("--------- <TaskEncryptResource> : END ----------");
+ LogDebug("--------- <TaskEncryptResource> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
#include <widget_install/directory_api.h>
#include <dpl/utils/wrt_utility.h>
#include <dpl/foreach.h>
+#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <dpl/errno_string.h>
#include <dpl/utils/folder_size.h>
#include <string>
#include <fstream>
#include <widget_install_to_external.h>
-#include <installer_log.h>
#define WEBAPP_DEFAULT_UID 5000
#define WEBAPP_DEFAULT_GID 5000
void changeOwnerForDirectory(std::string storagePath, mode_t mode) {
if (euidaccess(storagePath.c_str(), F_OK) != 0) {
if (!WrtUtilMakeDir(storagePath, mode)) {
- _E("Failed to create directory : %s", storagePath.c_str());
+ LogError("Failed to create directory : " << storagePath);
ThrowMsg(Jobs::WidgetInstall::Exceptions::FileOperationFailed,
"Failed to create directory : " << storagePath);
}
"Chown to invaild user");
}
} else if (euidaccess(storagePath.c_str(), W_OK | R_OK | X_OK) == 0) {
- _D("%s already exists.", storagePath.c_str());
+ LogDebug(storagePath << " already exists.");
// Even if private directory already is created, private dircetory
// should change owner.
if (chown(storagePath.c_str(),
// If package type is widget with osp service, we don't need to make bin
// and src directory
if (m_context.widgetConfig.packagingType == PKG_TYPE_HYBRID_WEB_APP) {
- _D("Doesn't need to create resource directory");
+ LogDebug("Doesn't need to create resource directory");
} else {
- _D("Create resource directory");
+ LogDebug("Create resource directory");
WrtUtilMakeDir(widgetBinPath);
WrtUtilMakeDir(widgetSrcPath);
if (m_context.mode.installTime == InstallMode::InstallTime::PRELOAD) {
void TaskFileManipulation::StepCreatePrivateStorageDir()
{
std::string storagePath = m_context.locations->getPrivateStorageDir();
- _D("Create private storage directory : %s", m_context.locations->getPrivateStorageDir().c_str());
+ LogDebug("Create private storage directory : " <<
+ m_context.locations->getPrivateStorageDir());
changeOwnerForDirectory(storagePath, PRIVATE_STORAGE_MODE);
if (m_context.isUpdateMode) { //update
std::string backData = m_context.locations->getBackupPrivateDir();
- _D("copy private storage %s to %s", backData.c_str(), storagePath.c_str());
+ LogDebug("copy private storage " << backData << " to " << storagePath);
if (!DirectoryApi::DirectoryCopy(backData, storagePath)) {
- _E("Failed to rename %s to %s", backData.c_str(), storagePath.c_str());
+ LogError("Failed to rename " << backData << " to " << storagePath);
ThrowMsg(Exceptions::BackupFailed,
"Error occurs copy private strage files");
}
}
std::string tempStoragePath = m_context.locations->getPrivateTempStorageDir();
- _D("Create temp private storage directory : %s", tempStoragePath.c_str());
+ LogDebug("Create temp private storage directory : " << tempStoragePath);
changeOwnerForDirectory(tempStoragePath, PRIVATE_STORAGE_MODE);
}
instDir = m_context.locations->getSourceDir();
}
- _D("Copy file from temp directory to %s", instDir.c_str());
+ LogDebug("Copy file from temp directory to " << instDir);
if (!WrtUtilRemove(instDir)) {
ThrowMsg(Exceptions::RemovingFolderFailure,
"Error occurs during removing existing folder");
WrtDB::GlobalConfig::GetWidgetResPath();
if (0 != access(optRes.c_str(), F_OK)) {
- _D("Make symbolic name for preload app %s to %s", usrRes.c_str(), optRes.c_str());
+ LogDebug("Make symbolic name for preload app" <<
+ usrRes << " to " << optRes);
if (symlink(usrRes.c_str(), optRes.c_str()) != 0)
{
int error = errno;
if (error)
- _E("Failed to make a symbolic name for a file [%s]", (DPL::GetErrnoString(error)).c_str());
+ LogPedantic("Failed to make a symbolic name for a file "
+ << "[" << DPL::GetErrnoString(error) << "]");
ThrowMsg(Exceptions::FileOperationFailed,
"Symbolic link creating is not done.");
}
std::string dataDir = m_context.locations->getPackageInstallationDir() +
"/" + WrtDB::GlobalConfig::GetWidgetPrivateStoragePath();
if (0 != access(dataDir.c_str(), F_OK)) {
- _D("Make symbolic name for preload app %s to %s", storagePath.c_str(), dataDir.c_str());
+ LogDebug("Make symbolic name for preload app " <<
+ storagePath << " to " << dataDir);
if (symlink(storagePath.c_str(), dataDir.c_str()) != 0)
{
int error = errno;
if (error)
- _E("Failed to make a symbolic name for a file [%s]", (DPL::GetErrnoString(error)).c_str());
+ LogPedantic("Failed to make a symbolic name for a file "
+ << "[" << DPL::GetErrnoString(error) << "]");
ThrowMsg(Exceptions::FileOperationFailed,
"Symbolic link creating is not done.");
}
if (m_context.widgetConfig.packagingType != PKG_TYPE_HYBRID_WEB_APP) {
std::string widgetBinPath = m_context.locations->getBinaryDir();
std::string userBinPath = m_context.locations->getUserBinaryDir();
- _D("Make symbolic link for preload app %s to %s", widgetBinPath.c_str(), userBinPath.c_str());
+ LogDebug("Make symbolic link for preload app " << widgetBinPath <<
+ " to " << userBinPath);
if (symlink(widgetBinPath.c_str(), userBinPath.c_str()) != 0)
{
int error = errno;
if (error)
- _E("Failed to make a symbolic name for a file [%s]", (DPL::GetErrnoString(error)).c_str());
+ LogPedantic("Failed to make a symbolic name for a file "
+ << "[" << DPL::GetErrnoString(error) << "]");
ThrowMsg(Exceptions::FileOperationFailed,
"Symbolic link creating is not done.");
}
void TaskFileManipulation::StepAbortRenamePath()
{
- _D("[Rename Widget Path] Aborting.... (Rename path)");
+ LogDebug("[Rename Widget Path] Aborting.... (Rename path)");
std::string widgetPath;
widgetPath = m_context.locations->getPackageInstallationDir();
if (!WrtUtilRemove(widgetPath)) {
- _E("Error occurs during removing existing folder");
+ LogError("Error occurs during removing existing folder");
}
// Remove user data directory if preload web app.
std::string userData = m_context.locations->getUserDataRootDir();
if (0 == access(userData.c_str(), F_OK)) {
if (!WrtUtilRemove(userData)) {
- _E("Error occurs during removing user data directory");
+ LogError("Error occurs during removing user data directory");
}
}
- _D("Rename widget path sucessful!");
+ LogDebug("Rename widget path sucessful!");
}
void TaskFileManipulation::StepPrepareExternalDir()
{
- _D("Step prepare to install in exernal directory");
+ LogDebug("Step prepare to install in exernal directory");
Try {
std::string pkgid =
DPL::ToUTF8String(m_context.widgetConfig.tzPkgid);
void TaskFileManipulation::StepInstallToExternal()
{
- _D("StepInstallExternal");
+ LogDebug("StepInstallExternal");
if (!WrtUtilMakeDir(m_context.locations->getSourceDir())) {
ThrowMsg(Exceptions::ErrorExternalInstallingFailure,
"To make src \
directory failed");
}
- _D("Resource move to external storage %s", m_context.locations->getSourceDir().c_str());
+ LogDebug("Resource move to external storage " <<
+ m_context.locations->getSourceDir());
if (!_FolderCopy(m_context.locations->getTemporaryPackageDir(),
m_context.locations->getSourceDir()))
{
void TaskFileManipulation::StepAbortCreateExternalDir()
{
- _E("Abort StepAbortCreateExternalDir");
+ LogError("Abort StepAbortCreateExternalDir");
if (m_context.isUpdateMode) {
WidgetInstallToExtSingleton::Instance().postUpgrade(false);
} else {
void TaskFileManipulation::StepCreateSharedFolder()
{
- _D("StepCreateSharedFolder");
+ LogDebug("StepCreateSharedFolder");
std::string sharedPath = m_context.locations->getSharedRootDir();
- _D("Create shared directory : %s", m_context.locations->getSharedRootDir().c_str());
+ LogDebug("Create shared directory : " <<
+ m_context.locations->getSharedRootDir());
WrtUtilMakeDir(sharedPath);
WrtUtilMakeDir(m_context.locations->getSharedResourceDir());
&& m_context.mode.installTime == InstallMode::InstallTime::PRELOAD)) {
/* Restore /shared/data */
- _D("copy %s to %s", m_context.locations->getBackupSharedDataDir().c_str(), m_context.locations->getSharedDataDir().c_str());
+ LogDebug("copy " << m_context.locations->getBackupSharedDataDir() <<
+ " to " << m_context.locations->getSharedDataDir());
if (!DirectoryApi::DirectoryCopy(
m_context.locations->getBackupSharedDataDir(),
m_context.locations->getSharedDataDir())) {
- _E("Failed to rename %s to %s", m_context.locations->getBackupSharedDataDir().c_str(), m_context.locations->getSharedDataDir().c_str());
+ LogError("Failed to rename " <<
+ m_context.locations->getBackupSharedDataDir() <<
+ " to " << m_context.locations->getSharedDataDir());
ThrowMsg(Exceptions::BackupFailed,
"Error occurs copy shared strage files");
}
/* Restore /shared/trusted */
- _D("copy %s to %s", m_context.locations->getBackupSharedTrustedDir().c_str(), m_context.locations->getSharedTrustedDir().c_str());
+ LogDebug("copy " << m_context.locations->getBackupSharedTrustedDir() <<
+ " to " << m_context.locations->getSharedTrustedDir());
if (!DirectoryApi::DirectoryCopy(
m_context.locations->getBackupSharedTrustedDir(),
m_context.locations->getSharedTrustedDir())) {
- _E("Failed to rename %s to %s", m_context.locations->getBackupSharedTrustedDir().c_str(), m_context.locations->getSharedTrustedDir().c_str());
+ LogError("Failed to rename " <<
+ m_context.locations->getBackupSharedTrustedDir() << " to " <<
+ m_context.locations->getSharedTrustedDir());
ThrowMsg(Exceptions::BackupFailed,
"Error occurs copy shared strage files");
}
void TaskFileManipulation::StartStep()
{
- _D("--------- <TaskFileManipulation> : START ----------");
+ LogDebug("--------- <TaskFileManipulation> : START ----------");
}
void TaskFileManipulation::EndStep()
{
- _D("--------- <TaskFileManipulation> : END ----------");
+ LogDebug("--------- <TaskFileManipulation> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
#include <pkgmgr/pkgmgr_parser.h>
#include <pkgmgr-info.h>
#include <fstream>
+#include <dpl/log/log.h>
#include <dpl/errno_string.h>
#include <dpl/foreach.h>
#include <dpl/wrt-dao-ro/global_config.h>
#include <widget_install/widget_install_context.h>
#include <widget_install/widget_install_errors.h>
-#include <installer_log.h>
-
using namespace WrtDB;
namespace {
void TaskInstallOspsvc::StepInstallOspService()
{
- _D("Step: installation for osp service");
+ LogDebug("Step: installation for osp service");
std::ostringstream commStr;
commStr << OSP_INSTALL_STR << BashUtils::escape_arg(
m_context.locations->getPackageInstallationDir());
//commStr << " 2>&1";
- _D("osp install command : %s", commStr.str().c_str());
+ LogDebug("osp install command : " << commStr.str());
char readBuf[MAX_BUF_SIZE];
FILE *fd;
fd = popen(commStr.str().c_str(), "r");
if (NULL == fd) {
- _E("Failed to installtion osp service");
+ LogError("Failed to installtion osp service");
ThrowMsg(Exceptions::InstallOspsvcFailed,
"Error occurs during\
install osp service");
if (fgets(readBuf, MAX_BUF_SIZE, fd) == NULL)
{
- _E("Failed to installtion osp service.\
+ LogError("Failed to installtion osp service.\
Inability of reading file.");
ThrowMsg(Exceptions::InstallOspsvcFailed,
"Error occurs during\
install osp service");
}
- _D("return value : %s", readBuf);
+ LogDebug("return value : " << readBuf);
int result = atoi(readBuf);
if (0 != result) {
void TaskInstallOspsvc::StartStep()
{
- _D("--------- <TaskInstallOspsvc> : START ----------");
+ LogDebug("--------- <TaskInstallOspsvc> : START ----------");
}
void TaskInstallOspsvc::EndStep()
InstallerContext::INSTALL_INSTALL_OSPSVC,
"Installed Osp servcie");
- _D("--------- <TaskInstallOspsvc> : END ----------");
+ LogDebug("--------- <TaskInstallOspsvc> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
#include <web_provider_plugin_info.h>
#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/wrt-dao-ro/config_parser_data.h>
+#include <dpl/log/log.h>
#include <dpl/file_input.h>
#include <dpl/errno_string.h>
#include <dpl/file_output.h>
#include <dpl/localization/LanguageTagsProvider.h>
#include <dpl/utils/path.h>
-#include <installer_log.h>
-
#define DEFAULT_ICON_NAME "icon.png"
#define DEFAULT_PREVIEW_NAME "preview.png"
DPL::String langTag = tag;
- _D("Trying to map language tag: %ls", langTag.c_str());
+ LogDebug("Trying to map language tag: " << langTag);
size_t pos = langTag.find_first_of(L'_');
if (pos != DPL::String::npos) {
langTag.erase(pos);
LanguageTagMap::iterator it = TagsMap.find(langTag);
if (it != TagsMap.end()) {
ret = it->second;
- _D("Mapping IANA Language tag to language tag: %ls -> %ls", langTag.c_str(), (*ret).c_str());
}
+ LogDebug("Mapping IANA Language tag to language tag: " <<
+ langTag << " -> " << ret);
return ret;
}
{
int error = errno;
if (error)
- _E("Failed to make a symbolic name for a file [%s]", DPL::GetErrnoString(error).c_str());
+ LogPedantic("Failed to make a symbolic name for a file "
+ << "[" << DPL::GetErrnoString(error) << "]");
}
// app-control widgets
if (symlink(clientExeStr.c_str(), controlExec.c_str()) != 0) {
int error = errno;
if (error) {
- _E("Failed to make a symbolic name for a file [%s]", DPL::GetErrnoString(error).c_str());
+ LogPedantic("Failed to make a symbolic name for a file "
+ << "[" << DPL::GetErrnoString(error) << "]");
}
}
}
#else
//default widget
- _D("link -s %s %s", clientExeStr.c_str(), exec.c_str());
+ LogDebug("link -s " << clientExeStr << " " << exec);
errno = 0;
if (symlink(clientExeStr.c_str(), exec.c_str()) != 0)
{
int error = errno;
if (error)
- _E("Failed to make a symbolic name for a file [%s]", DPL::GetErrnoString(error).c_str());
+ LogPedantic("Failed to make a symbolic name for a file "
+ << "[" << DPL::GetErrnoString(error) << "]");
}
#endif
if (symlink(boxExec.c_str(), boxSymlink.c_str()) != 0) {
if (errno) {
- _E("Failed to make a symbolic name for a file [%s]", DPL::GetErrnoString(errno).c_str());
+ LogPedantic("Failed to make a symbolic name for a file "
+ << "[" << DPL::GetErrnoString(errno) << "]");
}
}
}
void TaskManifestFile::stepCopyIconFiles()
{
- _D("CopyIconFiles");
+ LogDebug("CopyIconFiles");
//This function copies icon to desktop icon path. For each locale avaliable
//which there is at least one icon in widget for, icon file is copied.
DPL::String src = icon->src;
FOREACH(locale, icon->availableLocales)
{
- _D("Icon for locale: %ls is: %ls", (*locale).c_str(), src.c_str());
+ LogDebug("Icon for locale: " << *locale << "is: " << src);
if (std::find(generatedLocales.begin(), generatedLocales.end(),
*locale) != generatedLocales.end())
{
- _D("Skipping - has that locale");
+ LogDebug("Skipping - has that locale");
continue;
} else {
generatedLocales.push_back(*locale);
targetFile.Fullpath());
}
- _D("Copying icon: %s -> %s", sourceFile.Filename().c_str(), targetFile.Filename().c_str());
+ LogDebug("Copying icon: " << sourceFile << " -> " << targetFile);
icon_list.push_back(targetFile.Fullpath());
// Error while opening or closing source file
//ReThrowMsg(InstallerException::CopyIconFailed,
// sourceFile.str());
- _E(
+ LogError(
"Copying widget's icon failed. Widget's icon will not be" \
"available from Main Screen");
}
// Error while opening or closing target file
//ReThrowMsg(InstallerException::CopyIconFailed,
// targetFile.str());
- _E(
+ LogError(
"Copying widget's icon failed. Widget's icon will not be" \
"available from Main Screen");
}
// Error while copying
//ReThrowMsg(InstallerException::CopyIconFailed,
// targetFile.str());
- _E(
+ LogError(
"Copying widget's icon failed. Widget's icon will not be" \
"available from Main Screen");
}
void TaskManifestFile::stepCopyLiveboxFiles()
{
- _D("Copy Livebox Files");
+ LogDebug("Copy Livebox Files");
using namespace WrtDB;
ConfigParserData &data = m_context.widgetConfig.configInfo;
}
Catch(DPL::Exception)
{
- _E("Copying Dynamic Box File Failed. %s to %s", sourceFile.c_str(), targetFile.c_str());
+ LogError("Copying Dynamic Box File Failed. " << sourceFile
+ << " to " << targetFile);
ReThrowMsg(Exceptions::DynamicBoxFailed, "Dynamic Box File Copy Failed.");
}
}
Try
{
if (isAdded) {
- _D("UiApplication for d-box is already added");
+ LogDebug("UiApplication for d-box is already added");
return false;
}
uiApp.setNodisplay(true);
}
Catch(DPL::Exception)
{
- _E("Adding UiApplication on xml is failed.");
+ LogError("Adding UiApplication on xml is failed.");
isAdded = false;
return false;
}
void TaskManifestFile::stepBackupIconFiles()
{
- _D("Backup Icon Files");
+ LogDebug("Backup Icon Files");
backup_dir << m_context.locations->getBackupDir() << "/";
void TaskManifestFile::stepAbortIconFiles()
{
- _D("Abrot Icon Files");
+ LogDebug("Abrot Icon Files");
FOREACH(it, icon_list)
{
- _D("Remove Update Icon : %ls", (*it).c_str());
+ LogDebug("Remove Update Icon : " << (*it));
unlink((*it).c_str());
}
}
Catch(DPL::FileInput::Exception::Base)
{
- _E("Restoration icon File Failed. %s to %s", backup_file.str().c_str(), res_file.str().c_str());
+ LogError("Restoration icon File Failed." << backup_file.str()
+ << " to " << res_file.str());
}
Catch(DPL::FileOutput::Exception::Base)
{
- _E("Restoration icon File Failed. %s to %s", backup_file.str().c_str(), res_file.str().c_str());
+ LogError("Restoration icon File Failed." << backup_file.str()
+ << " to " << res_file.str());
}
Catch(DPL::CopyFailed)
{
- _E("Restoration icon File Failed. %s to %s", backup_file.str().c_str(), res_file.str().c_str());
+ LogError("Restoration icon File Failed." << backup_file.str()
+ << " to " << res_file.str());
}
}
}
void TaskManifestFile::backupIconFiles()
{
- _D("Backup Icon Files");
+ LogDebug("Backup Icon Files");
std::ostringstream b_icon_dir;
b_icon_dir << backup_dir.str() << "icons";
- _D("Create icon backup folder : %s", b_icon_dir.str().c_str());
+ LogDebug("Create icon backup folder : " << b_icon_dir.str());
WrtUtilMakeDir(b_icon_dir.str());
std::list<std::string> fileList;
backup_icon << b_icon_dir.str() << "/" << (*it);
- _D("Backup icon file %s to %s", icon_file.str().c_str(), backup_icon.str().c_str());
+ LogDebug("Backup icon file " << icon_file.str() << " to " <<
+ backup_icon.str());
Try
{
DPL::FileInput input(icon_file.str());
}
Catch(DPL::FileInput::Exception::Base)
{
- _E("Backup Desktop File Failed.");
+ LogError("Backup Desktop File Failed.");
ReThrowMsg(Exceptions::BackupFailed, icon_file.str());
}
Catch(DPL::FileOutput::Exception::Base)
{
- _E("Backup Desktop File Failed.");
+ LogError("Backup Desktop File Failed.");
ReThrowMsg(Exceptions::BackupFailed, backup_icon.str());
}
Catch(DPL::CopyFailed)
{
- _E("Backup Desktop File Failed.");
+ LogError("Backup Desktop File Failed.");
ReThrowMsg(Exceptions::BackupFailed, backup_icon.str());
}
unlink((*it).c_str());
{
DIR* dir = opendir(path);
if (!dir) {
- _E("icon directory doesn't exist");
+ LogError("icon directory doesn't exist");
ThrowMsg(Exceptions::FileOperationFailed, path);
}
}
if (return_code != 0 || errno != 0) {
- _E("readdir_r() failed with %s", DPL::GetErrnoString().c_str());
+ LogError("readdir_r() failed with " << DPL::GetErrnoString());
}
if (-1 == TEMP_FAILURE_RETRY(closedir(dir))) {
- _E("Failed to close dir: %s with error: %s", path, DPL::GetErrnoString().c_str());
+ LogError("Failed to close dir: " << path << " with error: "
+ << DPL::GetErrnoString());
}
}
destFile << DPL::ToUTF8String(manifest_name);
commit_manifest = destFile.str();
- _D("Commiting manifest file : %s", commit_manifest.c_str());
+ LogDebug("Commiting manifest file : " << commit_manifest);
commitManifest();
if (!(m_context.mode.rootPath == InstallMode::RootPath::RO &&
m_context.mode.installTime == InstallMode::InstallTime::PRELOAD
&& m_context.mode.extension == InstallMode::ExtensionType::DIR)) {
- _D("cp %s %s", manifest_file.c_str(), commit_manifest.c_str());
+ LogDebug("cp " << manifest_file << " " << commit_manifest);
DPL::FileInput input(DPL::ToUTF8String(manifest_file));
DPL::FileOutput output(commit_manifest);
DPL::Copy(&input, &output);
- _D("Manifest writen to: %s", commit_manifest.c_str());
+ LogDebug("Manifest writen to: " << commit_manifest);
//removing temp file
unlink((DPL::ToUTF8String(manifest_file)).c_str());
void TaskManifestFile::writeManifest(const DPL::String & path)
{
- _D("Generating manifest file : %ls", path.c_str());
+ LogDebug("Generating manifest file : " << path);
Manifest manifest;
UiApplication uiApp;
#endif
manifest.generate(path);
- _D("Manifest file serialized");
+ LogDebug("Manifest file serialized");
}
void TaskManifestFile::setWidgetExecPath(UiApplication & uiApp,
if (!postfix.empty()) {
exec.append(postfix);
}
- _D("exec = %s", exec.c_str());
+ LogDebug("exec = " << exec);
uiApp.setExec(DPL::FromASCIIString(exec));
}
if (std::find(generatedLocales.begin(), generatedLocales.end(),
*locale) != generatedLocales.end())
{
- _D("Skipping - has that locale - already in manifest");
+ LogDebug("Skipping - has that locale - already in manifest");
continue;
} else {
generatedLocales.push_back(*locale);
m_context.widgetConfig.configInfo.appControlList;
if (appControlList.empty()) {
- _D("Widget doesn't contain app control");
+ LogDebug("Widget doesn't contain app control");
return;
}
m_context.widgetConfig.configInfo.categoryList;
if (categoryList.empty()) {
- _D("Widget doesn't contain application category");
+ LogDebug("Widget doesn't contain application category");
return;
}
FOREACH(it, categoryList) {
m_context.widgetConfig.configInfo.metadataList;
if (metadataList.empty()) {
- _D("Web application doesn't contain metadata");
+ LogDebug("Web application doesn't contain metadata");
return;
}
FOREACH(it, metadataList) {
m_context.widgetConfig.configInfo.m_livebox;
if (liveboxList.empty()) {
- _D("no livebox");
+ LogDebug("no livebox");
return;
}
if (!addBoxUiApplication(manifest)) {
- _D("error during adding UiApplication for d-box");
+ LogDebug("error during adding UiApplication for d-box");
return;
}
FOREACH(it, liveboxList) {
- _D("setLiveBoxInfo");
+ LogDebug("setLiveBoxInfo");
LiveBoxInfo liveBox;
DPL::Optional<WrtDB::ConfigParserData::LiveboxInfo> ConfigInfo = *it;
DPL::String appid = m_context.widgetConfig.tzAppid;
if (ConfigInfo->m_boxInfo.m_boxSrc.empty() ||
ConfigInfo->m_boxInfo.m_boxSize.empty())
{
- _D("Widget doesn't contain box");
+ LogDebug("Widget doesn't contain box");
return;
} else {
BoxInfoType box;
AccountProviderType provider;
if (account.m_iconSet.empty()) {
- _D("Widget doesn't contain Account");
+ LogDebug("Widget doesn't contain Account");
return;
}
if (account.m_multiAccountSupport) {
#include <string>
#include <fstream>
+#include <dpl/log/log.h>
#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/foreach.h>
#include <dpl/sstream.h>
#include <widget_install/widget_install_context.h>
#include <widget_install/widget_install_errors.h>
-#include <installer_log.h>
-
using namespace WrtDB;
namespace {
m_manifest += "/opt/share/packages/";
}
m_manifest += DPL::ToUTF8String(m_context.widgetConfig.tzPkgid) + ".xml";
- _D("manifest file : %s", m_manifest.c_str());
+ LogDebug("manifest file : " << m_manifest);
if (m_context.isUpdateMode || (
m_context.mode.rootPath == InstallMode::RootPath::RO
m_manifest.c_str(), (updateTags[0] == NULL) ? NULL : updateTags);
if (code != 0) {
- _E("Manifest parser error: %d", code);
+ LogError("Manifest parser error: " << code);
ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code);
}
} else {
m_manifest.c_str(), (updateTags[0] == NULL) ? NULL : updateTags);
if (code != 0) {
- _E("Manifest parser error: %d", code);
+ LogError("Manifest parser error: " << code);
ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code);
}
}
m_context.job->UpdateProgress(
InstallerContext::INSTALL_PKGINFO_UPDATE,
"Manifest Update Finished");
- _D("Manifest parsed");
+ LogDebug("Manifest parsed");
}
void TaskPkgInfoUpdate::StepSetCertiInfo()
{
- _D("StepSetCertiInfo");
+ LogDebug("StepSetCertiInfo");
if (pkgmgr_installer_create_certinfo_set_handle(&m_pkgHandle) < 0) {
- _E("pkgmgrInstallerCreateCertinfoSetHandle fail");
+ LogError("pkgmgrInstallerCreateCertinfoSetHandle fail");
ThrowMsg(Exceptions::SetCertificateInfoFailed,
"Failed to create certificate handle");
}
m_context.widgetConfig.tzPkgid).c_str()),
m_pkgHandle)) < 0)
{
- _E("pkgmgrInstallerSaveCertinfo fail");
+ LogError("pkgmgrInstallerSaveCertinfo fail");
ThrowMsg(Exceptions::SetCertificateInfoFailed,
"Failed to Installer Save Certinfo");
} else {
- _D("Succeed to save Certinfo");
+ LogDebug("Succeed to save Certinfo");
}
if (pkgmgr_installer_destroy_certinfo_set_handle(m_pkgHandle) < 0) {
- _E("pkgmgrInstallerDestroyCertinfoSetHandle fail");
+ LogError("pkgmgrInstallerDestroyCertinfoSetHandle fail");
}
}
void TaskPkgInfoUpdate::SetCertiInfo(int source)
{
- _D("Set CertiInfo to pkgmgr : %d", source);
+ LogDebug("Set CertiInfo to pkgmgr : " << source);
CertificateChainList certificateChainList;
m_context.widgetSecurity.getCertificateChainList(certificateChainList,
(CertificateSource)source);
FOREACH(it, certificateChainList)
{
- _D("Insert certinfo to pkgmgr structure");
+ LogDebug("Insert certinfo to pkgmgr structure");
ValidationCore::CertificateCollection chain;
if (false == chain.load(*it)) {
- _E("Chain is broken");
+ LogError("Chain is broken");
ThrowMsg(Exceptions::SetCertificateInfoFailed,
"Failed to Installer Save Certinfo");
}
if (!chain.sort()) {
- _E("Chain failed at sorting");
+ LogError("Chain failed at sorting");
}
ValidationCore::CertificateList list = chain.getCertificateList();
}
if (distributor1) {
- _D("Set SIGNATURE_DISTRIBUTOR");
+ LogDebug("Set SIGNATURE_DISTRIBUTOR");
if ((*certIt)->isRootCert()) {
instCertType = PM_SET_DISTRIBUTOR_ROOT_CERT;
} else {
}
}
} else {
- _D("Set SIGNATURE_DISTRIBUTOR2");
+ LogDebug("Set SIGNATURE_DISTRIBUTOR2");
if ((*certIt)->isRootCert()) {
instCertType = PM_SET_DISTRIBUTOR2_ROOT_CERT;
} else {
if ((*certIt)->isCA()) {
- instCertType = PM_SET_DISTRIBUTOR2_INTERMEDIATE_CERT;
+ instCertType =
+ PM_SET_DISTRIBUTOR2_INTERMEDIATE_CERT;
} else {
instCertType = PM_SET_DISTRIBUTOR2_SIGNER_CERT;
}
}
}
} else {
- _D("set SIGNATURE_AUTHOR");
+ LogDebug("set SIGNATURE_AUTHOR");
if ((*certIt)->isRootCert()) {
instCertType = PM_SET_AUTHOR_ROOT_CERT;
} else {
}
}
}
- _D("cert type : %d", instCertType);
+ LogDebug("cert type : " << instCertType);
if ((pkgmgr_installer_set_cert_value(
m_pkgHandle,
instCertType,
const_cast<char*>(((*certIt)->getBase64()).c_str()))) < 0)
{
- _E("pkgmgrInstallerSetCertValue fail");
+ LogError("pkgmgrInstallerSetCertValue fail");
ThrowMsg(Exceptions::SetCertificateInfoFailed,
"Failed to Set CertValue");
}
m_context.widgetConfig.tzPkgid).c_str()))) <
0)
{
- _E("pkgmgr_installer_delete_certinfo fail");
+ LogError("pkgmgr_installer_delete_certinfo fail");
}
}
void TaskPkgInfoUpdate::StartStep()
{
- _D("--------- <TaskPkgInfoUpdate> : START ----------");
+ LogDebug("--------- <TaskPkgInfoUpdate> : START ----------");
}
void TaskPkgInfoUpdate::EndStep()
InstallerContext::INSTALL_SET_CERTINFO,
"Save certinfo to pkgmgr");
- _D("--------- <TaskPkgInfoUpdate> : END ----------");
+ LogDebug("--------- <TaskPkgInfoUpdate> : END ----------");
}
void TaskPkgInfoUpdate::stepAbortParseManifest()
{
- _E("[Parse Manifest] Abroting....");
+ LogError("[Parse Manifest] Abroting....");
int code = pkgmgr_parser_parse_manifest_for_uninstallation(
m_manifest.c_str(), NULL);
if (0 != code) {
- _W("Manifest parser error: %d", code);
+ LogWarning("Manifest parser error: " << code);
ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code);
}
int ret = unlink(m_manifest.c_str());
if (0 != ret) {
- _W("No manifest file found: %s", m_manifest.c_str());
+ LogWarning("No manifest file found: " << m_manifest);
}
}
#include <dpl/file_output.h>
#include <dpl/file_input.h>
#include <dpl/copy.h>
+#include <dpl/log/log.h>
#include <dpl/wrt-dao-ro/feature_dao_read_only.h>
#include <dpl/foreach.h>
#include <widget_install/widget_install_context.h>
#include <widget_install_errors.h>
#include <task_commons.h>
-#include <installer_log.h>
namespace Jobs {
namespace WidgetInstall {
void TaskPrepareFiles::CopyFile(const std::string& source)
{
if (source.empty()) {
- _W("No source file specified");
+ LogWarning("No source file specified");
return;
}
std::string target =
m_installerContext.locations->getTemporaryPackageDir() + '/' +
filename;
- _D("source %s", source.c_str());
- _D("target %s", target.c_str());
+ LogDebug("source " << source);
+ LogDebug("target " << target);
Try
{
}
Catch(DPL::FileInput::Exception::Base)
{
- _E("File input error");
+ LogError("File input error");
// Error while opening or closing source file
ReThrowMsg(Exceptions::CopyIconFailed, source);
}
Catch(DPL::FileOutput::Exception::Base)
{
- _E("File output error");
+ LogError("File output error");
// Error while opening or closing target file
ReThrowMsg(Exceptions::CopyIconFailed, target);
}
Catch(DPL::CopyFailed)
{
- _E("File copy error");
+ LogError("File copy error");
// Error while copying
ReThrowMsg(Exceptions::CopyIconFailed, target);
}
+ 1);
}
- _D("Icons copy...");
+ LogDebug("Icons copy...");
FOREACH(it, m_installerContext.widgetConfig.configInfo.iconsList) {
std::ostringstream os;
- _D("Coping: %s%ls", sourceDir.c_str(), DPL::ToUTF8String(it->src).c_str());
+ LogDebug("Coping: " << sourceDir << DPL::ToUTF8String(it->src));
os << sourceDir << DPL::ToUTF8String(it->src);
CopyFile(os.str());
}
void TaskPrepareFiles::StartStep()
{
- _D("--------- <TaskPrepareFiles> : START ----------");
+ LogDebug("--------- <TaskPrepareFiles> : START ----------");
}
void TaskPrepareFiles::EndStep()
{
- _D("--------- <TaskPrepareFiles> : END ----------");
+ LogDebug("--------- <TaskPrepareFiles> : END ----------");
}
} // namespace WidgetInstall
} // namespace Jobs
#include <dpl/task.h>
#include <dpl/string.h>
+#include <dpl/log/log.h>
#include <dpl/foreach.h>
#include <dpl/utils/wrt_utility.h>
#include <widget_install/widget_install_errors.h>
#include <widget_install/job_widget_install.h>
-#include <installer_log.h>
-
namespace Jobs {
namespace WidgetInstall {
namespace {
void createDir(const std::string& path)
{
if (WrtUtilMakeDir(path)) {
- _D("Create directory : %s", path.c_str());
+ LogDebug("Create directory : " << path);
} else {
ThrowMsg(Exceptions::RDSDeltaFailure, "Fail to create dir" << path);
}
void TaskPrepareReinstall::StepPrepare()
{
- _D("Prepare");
+ LogDebug("Prepare");
m_sourcePath = m_context.locations->getTemporaryPackageDir();
m_sourcePath += "/";
void TaskPrepareReinstall::StepParseRDSDelta()
{
- _D("parse RDS delta");
+ LogDebug("parse RDS delta");
std::string rdsDeltaPath = m_sourcePath;
rdsDeltaPath += ".rds_delta";
std::ifstream delta(rdsDeltaPath);
while (std::getline(delta, line) &&!delta.eof()) {
FOREACH(keyIt, keyList) {
if (line == *keyIt) {
- _D("find key = [%s]", line.c_str());
+ LogDebug("find key = [" << line << "]");
key = line;
break;
}
}
if (key == KEY_DELETE) {
m_deleteFileList.push_back(line);
- _D("line = [%s]", line.c_str());
+ LogDebug("line = [" << line << "]");
} else if (key == KEY_ADD) {
m_addFileList.push_back(line);
- _D("line = [%s]", line.c_str());
+ LogDebug("line = [" << line << "]");
} else if (key == KEY_MODIFY) {
m_modifyFileList.push_back(line);
- _D("line = [%s]", line.c_str());
+ LogDebug("line = [" << line << "]");
}
}
}
void TaskPrepareReinstall::StepVerifyRDSDelta()
{
- _D("verify RDS delta");
+ LogDebug("verify RDS delta");
// Verify ADD file
FOREACH(file, m_addFileList) {
std::string addFilePath = m_sourcePath;
existingFilePath += *file;
verifyFile(existingFilePath);
}
- _D("Finished veify RDS Delta");
+ LogDebug("Finished veify RDS Delta");
m_context.job->UpdateProgress(
InstallerContext::INSTALL_RDS_DELTA_CHECK,
void TaskPrepareReinstall::StepAddFile()
{
- _D("Add file");
+ LogDebug("Add file");
FOREACH(file, m_addFileList) {
std::string newfile = m_sourcePath;
newfile += *file;
ThrowMsg(Exceptions::RDSDeltaFailure,
"Fail to add file " << newfile);
}
- _D("Add %s to %s", newfile.c_str(), destPath.c_str());
+ LogDebug("Add " << newfile << " to " << destPath);
}
}
}
void TaskPrepareReinstall::StepDeleteFile()
{
- _D("Delete file");
+ LogDebug("Delete file");
FOREACH(file, m_deleteFileList) {
std::string deleteFilePath = m_installedPath;
deleteFilePath += *file;
ThrowMsg(Exceptions::RDSDeltaFailure,
"Fail to DELETE file " << deleteFilePath);
}
- _D("Delete %s", deleteFilePath.c_str());
+ LogDebug("Delete " << deleteFilePath);
}
}
void TaskPrepareReinstall::StepModifyFile()
{
- _D("Modify file");
+ LogDebug("Modify file");
FOREACH(file, m_modifyFileList) {
std::string destPath = m_installedPath;
destPath += *file;
ThrowMsg(Exceptions::RDSDeltaFailure,
"Fail to move new file" << destPath);
}
- _D("Replace %s to %s", newfile.c_str(), destPath.c_str());
+ LogDebug("Replace " << newfile << " to " << destPath);
}
}
void TaskPrepareReinstall::StartStep()
{
- _D("---------- <TaskPrepareReinstall> : START ----------");
+ LogDebug("--------- <TaskPrepareReinstall> : START ----------");
}
void TaskPrepareReinstall::EndStep()
InstallerContext::INSTALL_RDS_PREPARE,
"RDS prepare finished");
- _D("---------- <TaskPrepareReinstall> : END ----------");
+ LogDebug("--------- <TaskPrepareReinstall> : END ----------");
}
} //namespace WidgetInstall
#include <string>
#include <ail.h>
+#include <dpl/log/log.h>
#include <dpl/errno_string.h>
#include <dpl/foreach.h>
#include <widget_install/widget_install_context.h>
#include <widget_install/widget_install_errors.h>
-#include <installer_log.h>
-
using namespace WrtDB;
namespace Jobs {
void TaskRecovery::StartStep()
{
- _D("---------- <TaskRecovery> : START ----------");
+ LogDebug("--------- <TaskRecovery> : START ----------");
}
void TaskRecovery::EndStep()
InstallerContext::INSTALL_CHECK_FILE,
"Create information file for recovery");
- _D("---------- <TaskRecovery> : END ----------");
+ LogDebug("--------- <TaskRecovery> : END ----------");
}
void TaskRecovery::StepCreateCheckFile()
{
- _D("Step: create information file for recovery");
+ LogDebug("Step: create information file for recovery");
size_t pos = m_context.locations->getWidgetSource().rfind("/");
std::ostringstream infoPath;
m_context.installInfo = infoPath.str();
- _D("Create file : %s", m_context.installInfo.c_str());
+ LogDebug("Create file : " << m_context.installInfo);
} else {
ThrowMsg(Exceptions::FileOperationFailed, "Fail to create file for recovery.");
}
#include <sstream>
#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/foreach.h>
+#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <dpl/utils/wrt_utility.h>
#include <dpl/wrt-dao-rw/widget_dao.h>
#include <widget_install/widget_install_errors.h>
#include <widget_install/widget_install_context.h>
#include <wrt-commons/widget-interface-dao/widget_interface_dao.h>
-#include <installer_log.h>
using namespace WrtDB;
backupDir << m_context.locations->getBackupDir();
if (WrtUtilRemove(backupDir.str())) {
- _D("Success to remove backup files : %s", backupDir.str().c_str());
+ LogDebug("Success to remove backup files : " << backupDir.str());
} else {
- _E("Failed to remove backup directory : %s", backupDir.str().c_str());
+ LogError("Failed to remove backup directory : " << backupDir.str());
ThrowMsg(Exceptions::RemoveBackupFailed,
"Error occurs during removing existing folder");
}
std::string tmp = m_context.locations->getTemporaryPackageDir();
if (WrtUtilRemove(tmp)) {
- _D("Success to remove temp directory : %s", tmp.c_str());
+ LogDebug("Success to remove temp directory : " << tmp);
} else {
- _E("Failed to remove temp directory : %s", tmp.c_str());
+ LogError("Failed to remove temp directory : " << tmp);
}
}
void TaskRemoveBackupFiles::StepDeleteBackupDB()
{
- _D("StepDeleteBackupDB");
+ LogDebug("StepDeleteBackupDB");
std::string oldAppid =
DPL::ToUTF8String(m_context.widgetConfig.tzAppid) + ".backup";
}
Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
{
- _E("Fail to delete old version db information");
+ LogError("Fail to delete old version db information");
}
}
void TaskRemoveBackupFiles::StepDeleteBackupWidgetInterfaceDB()
{
- _D("StepDeleteBackupWidgetInterfaceDB");
+ LogDebug("StepDeleteBackupWidgetInterfaceDB");
using namespace WidgetInterfaceDB;
using namespace WrtDB;
// remove backup database
if (remove(backupDbPath.c_str()) != 0) {
- _W("Fail to remove");
+ LogWarning("Fail to remove");
}
}
void TaskRemoveBackupFiles::StartStep()
{
- _D("--------- <TaskRemoveBackupFiles> : START ----------");
+ LogDebug("--------- <TaskRemoveBackupFiles> : START ----------");
}
void TaskRemoveBackupFiles::EndStep()
{
- _D("--------- <TaskRemoveBackupFiles> : END ----------");
+ LogDebug("--------- <TaskRemoveBackupFiles> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
#include <sys/smack.h>
#endif
#include <sstream>
-#include <installer_log.h>
using namespace WrtDB;
using namespace ValidationCore;
void TaskSmack::StepSetInstall()
{
- _D("----------------> SMACK: StepStartSetSmack()");
+ LogDebug("----------------> SMACK: StepStartSetSmack()");
#ifdef WRT_SMACK_ENABLED
std::string pkg = DPL::ToUTF8String(m_context.widgetConfig.tzPkgid);
m_pkgId = (char*)calloc(1, pkg.length() + 1);
void TaskSmack::StepSmackFolderLabeling()
{
- _D("----------------> SMACK:\
+ LogDebug("----------------> SMACK:\
Jobs::WidgetInstall::TaskSmack::SmackFolderLabelingStep()");
#ifdef WRT_SMACK_ENABLED
/* /opt/usr/apps/[pkgid] directory's label is "_" */
if (PC_OPERATION_SUCCESS != perm_app_setup_path(m_pkgId,
m_context.locations->getPackageInstallationDir().c_str(),
APP_PATH_ANY_LABEL, "_")) {
- _W("Add label to %s", m_context.locations->getPackageInstallationDir().c_str());
+ LogWarning("Add label to " <<
+ m_context.locations->getPackageInstallationDir());
}
/* for prelaod */
if (PC_OPERATION_SUCCESS != perm_app_setup_path(m_pkgId, resDir.c_str(),
APP_PATH_PRIVATE)) {
- _W("Add label to %s", resDir.c_str());
+ LogWarning("Add label to " << resDir);
}
/* data directory */
if (PC_OPERATION_SUCCESS != perm_app_setup_path(m_pkgId,
m_context.locations->getPrivateStorageDir().c_str(),
APP_PATH_PRIVATE)) {
- _W("Add label to %s", m_context.locations->getPrivateStorageDir().c_str());
+ LogWarning("Add label to " << m_context.locations->getPrivateStorageDir());
}
/* tmp directory */
m_context.locations->getPrivateTempStorageDir().c_str(),
APP_PATH_PRIVATE))
{
- _W("Add label to %s", m_context.locations->getPrivateTempStorageDir().c_str());
+ LogWarning("Add label to " << m_context.locations->getPrivateTempStorageDir());
}
/* bin directory */
if (PC_OPERATION_SUCCESS != perm_app_setup_path(m_pkgId,
m_context.locations->getBinaryDir().c_str(),
APP_PATH_PRIVATE)) {
- _W("Add label to %s", m_context.locations->getBinaryDir().c_str());
+ LogWarning("Add label to " << m_context.locations->getBinaryDir());
}
if(!setLabelForSharedDir(m_pkgId)) {
- _W("Add label to shared directory");
+ LogWarning("Add label to shared directory");
}
free(m_pkgId);
void TaskSmack::StepSmackPrivilege()
{
- _D("----------------> SMACK:\
- Jobs::WidgetInstall::TaskSmack::SmackPrivilegeStep()");
+ LogDebug("----------------> SMACK:\
+ Jobs::WidgetInstall::TaskSmack::SmackPrivilegeStep()");
#ifdef WRT_SMACK_ENABLED
/* TODO :
std::string id = DPL::ToUTF8String(m_context.widgetConfig.tzAppid);
char** perm_list = new char*[privileges.size() + 1];
int index = 0;
FOREACH(it, privileges) {
- _D("Permission : %ls", it->name.c_str());
+ LogDebug("Permission : " << it->name);
int length = DPL::ToUTF8String(it->name).length();
char *priv = new char[length + 1];
snprintf(priv, length + 1, "%s",
if (PC_OPERATION_SUCCESS != perm_app_enable_permissions(appId, APP_TYPE_WGT,
const_cast<const char **>(perm_list), true)) {
- _W("failure in contructing smack rules based on perm_list");
+ LogWarning("failure in contructing smack rules based on perm_list");
}
free(appId);
void TaskSmack::StepRevokeForUpdate()
{
- _D("----------------> SMACK:\
- Jobs::WidgetInstall::TaskSmack::StepRevokePrivilegeForUpdate()");
+ LogDebug("----------------> SMACK:\
+ Jobs::WidgetInstall::TaskSmack::StepRevokePrivilegeForUpdate()");
#ifdef WRT_SMACK_ENABLED
if (PC_OPERATION_SUCCESS != perm_app_revoke_permissions(m_pkgId)) {
- _W("failure in revoking smack permissions");
+ LogWarning("failure in revoking smack permissions");
}
#endif
}
void TaskSmack::StepAbortSmack()
{
- _D("----------------> SMACK:\
+ LogDebug("----------------> SMACK:\
Jobs::WidgetInstall::TaskSmack::StepAbortSmack()");
#ifdef WRT_SMACK_ENABLED
if (PC_OPERATION_SUCCESS != perm_app_revoke_permissions(m_pkgId)) {
- _W("failure in revoking smack permissions");
+ LogWarning("failure in revoking smack permissions");
}
if (PC_OPERATION_SUCCESS != perm_app_uninstall(m_pkgId)) {
- _W("failure in removing smack rules file");
+ LogWarning("failure in removing smack rules file");
}
free(m_pkgId);
#endif
if (PC_OPERATION_SUCCESS != perm_app_setup_path(m_pkgId,
m_context.locations->getSharedRootDir().c_str(),
APP_PATH_ANY_LABEL, "_")) {
- _W("Add label to %s", m_context.locations->getUserDataRootDir().c_str());
+ LogWarning("Add label to " << m_context.locations->getUserDataRootDir());
}
/* /shared/res directory */
if (PC_OPERATION_SUCCESS != perm_app_setup_path(m_pkgId,
m_context.locations->getSharedResourceDir().c_str(),
APP_PATH_ANY_LABEL, "_")) {
- _W("Add label to %s", m_context.locations->getSharedResourceDir().c_str());
+ LogWarning("Add label to " << m_context.locations->getSharedResourceDir());
}
/* /shared/trusted directory */
iPos = sha1String.find("/");
}
- _D("sha1 label string : %s", sha1String.c_str());
+ LogDebug("sha1 label string : " << sha1String);
if (PC_OPERATION_SUCCESS != perm_app_setup_path(m_pkgId,
m_context.locations->getSharedTrustedDir().c_str(),
APP_PATH_GROUP_RW, sha1String.c_str())) {
- _W("Add label to %s", m_context.locations->getBinaryDir().c_str());
+ LogWarning("Add label to " << m_context.locations->getBinaryDir());
}
}
if (PC_OPERATION_SUCCESS != perm_app_setup_path(m_pkgId,
m_context.locations->getSharedDataDir().c_str(),
APP_PATH_PUBLIC_RO)) {
- _W("Add label to %s", m_context.locations->getSharedDataDir().c_str());
+ LogWarning("Add label to " << m_context.locations->getSharedDataDir());
}
return true;
void TaskSmack::StartStep()
{
- _D("--------- <TaskSmack> : START ----------");
+ LogDebug("--------- <TaskSmack> : START ----------");
}
void TaskSmack::EndStep()
{
- _D("--------- <TaskSmack> : END ----------");
+ LogDebug("--------- <TaskSmack> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
#include <widget_install/task_update_files.h>
#include <dpl/assert.h>
+#include <dpl/log/log.h>
#include <dpl/foreach.h>
#include <dpl/utils/wrt_utility.h>
#include <dpl/exception.h>
#include <dpl/errno_string.h>
-#include <installer_log.h>
-
using namespace WrtDB;
namespace {
void TaskUpdateFiles::StepBackupDirectory()
{
- _D("StepCreateBackupFolder");
+ LogDebug("StepCreateBackupFolder");
std::string backPath = m_context.locations->getBackupDir();
- _D("Backup resource directory path : %s", backPath.c_str());
+ LogDebug("Backup resource directory path : " << backPath);
std::string pkgPath = m_context.locations->getPackageInstallationDir();
if (0 == access(backPath.c_str(), F_OK)) {
"Error occurs during removing backup resource directory");
}
}
- _D("copy : %s to %s", pkgPath.c_str(), backPath.c_str());
+ LogDebug("copy : " << pkgPath << " to " << backPath);
if ((rename(pkgPath.c_str(), backPath.c_str())) != 0) {
- _E("Failed to rename %s to %s", pkgPath.c_str(), backPath.c_str());
+ LogError("Failed to rename " << pkgPath << " to " << backPath);
ThrowMsg(Exceptions::BackupFailed,
"Error occurs during rename file");
}
void TaskUpdateFiles::StepAbortBackupDirectory()
{
- _D("StepAbortCopyFiles");
+ LogDebug("StepAbortCopyFiles");
std::string backPath = m_context.locations->getBackupDir();
std::string pkgPath = m_context.locations->getPackageInstallationDir();
- _D("Backup Folder %s to %s", backPath.c_str(), pkgPath.c_str());
+ LogDebug("Backup Folder " << backPath << " to " << pkgPath);
if (!WrtUtilRemove(pkgPath)) {
- _E("Failed to remove %s", pkgPath.c_str());
+ LogError("Failed to remove " << pkgPath);
}
if (rename(backPath.c_str(), pkgPath.c_str()) != 0) {
- _E("Failed to rename %s to %s", backPath.c_str(), pkgPath.c_str());
+ LogError("Failed to rename " << backPath << " to " << pkgPath);
}
}
void TaskUpdateFiles::StartStep()
{
- _D("--------- <TaskUpdateFiles> : START ----------");
+ LogDebug("--------- <TaskUpdateFiles> : START ----------");
}
void TaskUpdateFiles::EndStep()
InstallerContext::INSTALL_CREATE_BACKUP_DIR,
"Backup directory created for update");
- _D("--------- <TaskUpdateFiles> : END ----------");
+ LogDebug("--------- <TaskUpdateFiles> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
#include <web_provider_livebox_info.h>
#include <manifest.h>
-#include <installer_log.h>
-
namespace { // anonymous
const DPL::String BR = DPL::FromUTF8String("<br>");
const std::string WIDGET_NOT_COMPATIBLE = "This widget is "
Try
{
std::string path = m_installContext.locations->getConfigurationDir();
- _D("path: %s", path.c_str());
+ LogDebug("path: " << path);
processFile(path, m_installContext.widgetConfig);
}
Catch(Exception::ConfigParseFailed)
{
- _E("Parsing failed.");
+ LogError("Parsing failed.");
ReThrow(Exceptions::WidgetConfigFileInvalid);
}
void TaskWidgetConfig::ReadLocaleFolders()
{
- _D("Reading locale");
+ LogDebug("Reading locale");
//Adding default locale
m_localeFolders.insert(L"");
m_installContext.locations->getConfigurationDir() + "/locales";
DIR* localeDir = opendir(localePath.c_str());
if (!localeDir) {
- _D("No /locales directory in the widget package.");
+ LogDebug("No /locales directory in the widget package.");
return;
}
absoluteDirName += dirent.d_name;
if (stat(absoluteDirName.c_str(), &statStruct) != 0) {
- _E("stat() failed with %s", DPL::GetErrnoString().c_str());
+ LogError("stat() failed with " << DPL::GetErrnoString());
continue;
}
if (S_ISDIR(statStruct.st_mode)) {
//Yes, we ignore current, parent & hidden directories
if (dirName[0] != L'.') {
- _D("Adding locale directory \"%s\"", dirName.c_str());
+ LogDebug("Adding locale directory \"" << dirName << "\"");
m_localeFolders.insert(dirName);
}
}
}
if (return_code != 0 || errno != 0) {
- _E("readdir_r() failed with %s", DPL::GetErrnoString().c_str());
+ LogError("readdir_r() failed with " << DPL::GetErrnoString());
}
if (-1 == TEMP_FAILURE_RETRY(closedir(localeDir))) {
- _E("Failed to close dir: %s with error: %s", localePath.c_str(), DPL::GetErrnoString().c_str());
+ LogError("Failed to close dir: " << localePath << " with error: "
+ << DPL::GetErrnoString());
}
}
void TaskWidgetConfig::ProcessIcon(const WrtDB::ConfigParserData::Icon& icon)
{
- _D("enter");
+ LogDebug("enter");
bool isAnyIconValid = false;
//In case a default filename is passed as custom filename in config.xml, we
//need to keep a set of already processed filenames to avoid icon
if (MimeTypeUtils::isMimeTypeSupportedForIcon(type)) {
isAnyIconValid = true;
localesAvailableForIcon.insert(*i);
- _D("Icon absolutePath: %ls, assigned locale: %ls, type: %ls",
- absolutePath.c_str(), (*i).c_str(), type.c_str());
+ LogDebug("Icon absolutePath :" << absolutePath <<
+ ", assigned locale :" << *i << ", type: " << type);
}
}
}
void TaskWidgetConfig::ProcessWidgetInstalledPath()
{
- _D("ProcessWidgetInstalledPath");
+ LogDebug("ProcessWidgetInstalledPath");
m_installContext.widgetConfig.widgetInstalledPath =
DPL::FromUTF8String(
m_installContext.locations->getPackageInstallationDir());
void TaskWidgetConfig::ProcessAppControlInfo()
{
- _D("ProcessAppControlInfo");
+ LogDebug("ProcessAppControlInfo");
using namespace WrtDB;
// In case of dispostion is inline, set the seperate execute
}
if (isSecurityModelV1 && isSecurityModelV2) {
- _E("Security model is conflict");
+ LogError("Security model is conflict");
ThrowMsg(Exceptions::NotAllowed, "Security model is conflict");
} else if (isSecurityModelV1) {
data.securityModelVersion =
m_installContext.widgetConfig.webAppType.appType,
m_installContext.widgetConfig.minVersion))
{
- _E("Platform version lower than required -> cancelling installation");
+ LogError(
+ "Platform version lower than required -> cancelling installation");
ThrowMsg(Exceptions::NotAllowed,
"Platform version does not meet requirements");
}
if (!isFeatureAllowed(m_installContext.widgetConfig.webAppType.appType,
it->name))
{
- _D("This application type not allowed to use this feature");
+ LogDebug("This application type not allowed to use this feature");
ThrowMsg(
Exceptions::WidgetConfigFileInvalid,
"This app type [" <<
boxType = DPL::ToUTF8String((**it).m_type);
}
- _D("livebox type: %s", boxType.c_str());
+ LogDebug("livebox type: " << boxType);
ConfigParserData::LiveboxInfo::BoxSizeList boxSizeList =
(**it).m_boxInfo.m_boxSize;
free(boxSize);
if(!chkSize) {
- _E("Invalid boxSize");
+ LogError("Invalid boxSize");
ThrowMsg(Exceptions::WidgetConfigFileInvalid, "Invalid boxSize");
}
}
DPL::String featureName)
{
using namespace WrtDB;
- _D("AppType = [%s]", WidgetType(appType).getApptypeToString().c_str());
- _D("FetureName = [%ls]", featureName.c_str());
+ LogDebug("AppType = [" <<
+ WidgetType(appType).getApptypeToString() << "]");
+ LogDebug("FetureName = [" << featureName << "]");
AppType featureType = APP_TYPE_UNKNOWN;
std::string featureStr = DPL::ToUTF8String(featureName);
std::istringstream inputString(version);
inputString >> majorVersion;
if (inputString.bad() || inputString.fail()) {
- _W("Invalid minVersion format.");
+ LogWarning("Invalid minVersion format.");
return false;
}
inputString.get(); // skip period
inputString >> minorVersion;
if (inputString.bad() || inputString.fail()) {
- _W("Invalid minVersion format");
+ LogWarning("Invalid minVersion format");
return false;
} else {
inputString.get(); // skip period
if (appType == WrtDB::AppType::APP_TYPE_TIZENWEBAPP) {
return false;
} else {
- _W("minVersion attribute is empty. WRT assumes platform "
- "supports this widget.");
+ LogWarning("minVersion attribute is empty. WRT assumes platform "
+ "supports this widget.");
return true;
}
}
if (!parseVersionString(DPL::ToUTF8String(*widgetVersion), majorWidget,
minorWidget, microWidget))
{
- _W("Invalid format of widget version string.");
+ LogWarning("Invalid format of widget version string.");
return false;
}
if (appType == WrtDB::AppType::APP_TYPE_TIZENWEBAPP) {
version = WrtDB::GlobalConfig::GetTizenVersion();
} else {
- _W("Invaild AppType");
+ LogWarning("Invaild AppType");
return false;
}
if (!parseVersionString(version,
majorSupported, minorSupported, microSupported))
{
- _W("Invalid format of platform version string.");
+ LogWarning("Invalid format of platform version string.");
return true;
}
(majorWidget == majorSupported && minorWidget == minorSupported
&& microWidget > microSupported))
{
- _D("Platform doesn't support this widget.");
+ LogDebug("Platform doesn't support this widget.");
return false;
}
return true;
}
Catch(ElementParser::Exception::Base)
{
- _E("Invalid widget configuration file!");
+ LogError("Invalid widget configuration file!");
return false;
}
return true;
WrtUtilJoinPaths(configFilePath, _currentPath, WRT_WIDGET_CONFIG_FILE_NAME);
if (!WrtUtilFileExists(configFilePath))
{
- _E("Archive does not contain configuration file");
+ LogError("Archive does not contain configuration file");
return false;
}
- _D("Configuration file: %s", configFilePath.c_str());
+ LogDebug("Configuration file: " << configFilePath);
Try
{
#ifdef SCHEMA_VALIDATION_ENABLED
if(!parser.Validate(configFilePath, WRT_WIDGETS_XML_SCHEMA))
{
- _E("Invalid configuration file - schema validation failed");
+ LogError("Invalid configuration file - schema validation failed");
return false;
}
#endif
}
Catch (ElementParser::Exception::Base)
{
- _E("Invalid configuration file!");
+ LogError("Invalid configuration file!");
return false;
}
}
pWidgetConfigInfo.guid = configInfo.widget_id;
} else {
if (pWidgetConfigInfo.guid != configInfo.widget_id) {
- _E("Invalid archive");
+ LogError("Invalid archive");
return false;
}
}
if (DPL::ToUTF8String(pWidgetConfigInfo.tzAppid).compare(
DPL::ToUTF8String(*configInfo.tizenAppId)) < 0)
{
- _E("Invalid archive - Tizen App ID not same error");
+ LogError("Invalid archive - Tizen App ID not same error");
return false;
}
}
if (!!configInfo.tizenPkgId) {
if (pWidgetConfigInfo.tzPkgid != *configInfo.tizenPkgId) {
- _E("Invalid archive - Tizen Pkg ID not same error");
+ LogError("Invalid archive - Tizen Pkg ID not same error");
return false;
}
}
pWidgetConfigInfo.version = configInfo.version;
} else {
if (pWidgetConfigInfo.version != configInfo.version) {
- _E("Invalid archive");
+ LogError("Invalid archive");
return false;
}
}
if (!locateAndParseConfigurationFile(path, widgetConfiguration,
DEFAULT_LANGUAGE))
{
- _W("Widget archive: Failed while parsing config file");
+ LogWarning("Widget archive: Failed while parsing config file");
ThrowMsg(Exception::ConfigParseFailed, path);
}
}
void TaskWidgetConfig::StartStep()
{
- _D("---------- <TaskWidgetConfig> : START ----------");
+ LogDebug("--------- <TaskWidgetConfig> : START ----------");
}
void TaskWidgetConfig::EndStep()
{
- _D("---------- <TaskWidgetConfig> : END ----------");
+ LogDebug("--------- <TaskWidgetConfig> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
#include <widget_install/widget_install_errors.h>
#include <widget_install/widget_install_context.h>
#include <widget_install/job_widget_install.h>
+#include <dpl/log/log.h>
#include <dpl/copy.h>
#include <dpl/file_output.h>
#include <dpl/abstract_waitable_input_adapter.h>
#include <task_commons.h>
#include <sys/stat.h>
#include <dlfcn.h>
-#include <installer_log.h>
using namespace WrtDB;
void WidgetUnzip::unzipProgress(const std::string &destination)
{
// Show file info
- _D("Unzipping: '%s', Comment: '%s', Compressed size: %lld, Uncompressed size: %lld",
- m_zipIterator->name.c_str(), m_zipIterator->comment.c_str(), m_zipIterator->compressedSize, m_zipIterator->uncompressedSize);
+ LogDebug("Unzipping: '" << m_zipIterator->name <<
+ "', Comment: '" << m_zipIterator->comment <<
+ "', Compressed size: " << m_zipIterator->compressedSize <<
+ ", Uncompressed size: " << m_zipIterator->uncompressedSize);
// Normalize file paths
// FIXME: Implement checking for invalid characters
// This is path
std::string newPath = destination + "/" +
fileName.substr(0, fileName.size() - 1);
- _D("Path to extract: %s", newPath.c_str());
+ LogPedantic("Path to extract: " << newPath);
// Create path in case of it is empty
createTempPath(newPath);
// This is regular file
std::string fileExtractPath = destination + "/" + fileName;
- _D("File to extract: %s", fileExtractPath.c_str());
+ LogPedantic("File to extract: " << fileExtractPath);
// Split into pat & file pair
PathAndFilePair pathAndFile = SplitFileAndPath(fileExtractPath);
- _D("Path and file: %s : %s", pathAndFile.path.c_str(), pathAndFile.file.c_str());
+ LogPedantic("Path and file: " <<
+ pathAndFile.path <<
+ " : " << pathAndFile.file);
// First, ensure that path exists
createTempPath(pathAndFile.path);
// Check whether there are more files to extract
if (++m_zipIterator == m_zip->end()) {
- _D("Unzip progress finished successfuly");
+ LogDebug("Unzip progress finished successfuly");
} else {
unzipProgress(destination);
}
bool WidgetUnzip::isDRMPackage(const std::string &source)
{
- _D("Enter : isDRMPackage()");
+ LogDebug("Enter : isDRMPackage()");
int ret = 0;
void* pHandle = NULL;
char* pErrorMsg = NULL;
pHandle = dlopen(DRM_LIB_PATH, RTLD_LAZY | RTLD_GLOBAL);
if (!pHandle) {
- _E("dlopen failed : %s [%s]", source.c_str(), dlerror());
+ LogError("dlopen failed : " << source << " [" << dlerror() << "]");
return false;
}
(dlsym(pHandle, "drm_oem_sapps_is_drm_file"));
pErrorMsg = dlerror();
if ((pErrorMsg != NULL) || (drm_oem_sapps_is_drm_file == NULL)) {
- _E("dlopen failed : %s [%s]", source.c_str(), dlerror());
+ LogError("dlopen failed : " << source << " [" << dlerror() << "]");
dlclose(pHandle);
return false;
}
ret = drm_oem_sapps_is_drm_file(source.c_str(), source.length());
dlclose(pHandle);
if (1 == ret) {
- _D("%s is DRM file", source.c_str());
+ LogDebug(source << " is DRM file");
return true;
}
- _D("%s isn't DRM file", source.c_str());
+ LogDebug(source << " isn't DRM file");
return false;
}
bool WidgetUnzip::decryptDRMPackage(const std::string &source, const std::string
&decryptedSource)
{
- _D("Enter : decryptDRMPackage()");
+ LogDebug("Enter : decryptDRMPackage()");
int ret = 0;
void* pHandle = NULL;
char* pErrorMsg = NULL;
pHandle = dlopen(DRM_LIB_PATH, RTLD_LAZY | RTLD_GLOBAL);
if (!pHandle) {
- _E("dlopen failed : %s [%s]", source.c_str(), dlerror());
+ LogError("dlopen failed : " << source << " [" << dlerror() << "]");
return false;
}
(dlsym(pHandle, "drm_oem_sapps_decrypt_package"));
pErrorMsg = dlerror();
if ((pErrorMsg != NULL) || (drm_oem_sapps_decrypt_package == NULL)) {
- _E("dlopen failed : %s [%s]", source.c_str(), dlerror());
+ LogError("dlopen failed : " << source << " [" << dlerror() << "]");
dlclose(pHandle);
return false;
}
decryptedSource.c_str(), decryptedSource.length());
dlclose(pHandle);
if (1 == ret) {
- _D("%s is decrypted : %s", source.c_str(), decryptedSource.c_str());
+ LogDebug(source << " is decrypted : " << decryptedSource);
return true;
}
return false;
std::string WidgetUnzip::getDecryptedPackage(const std::string &source)
{
- _D("Check DRM...");
+ LogDebug("Check DRM...");
if (isDRMPackage(source)) {
std::string decryptedFile;
size_t found = source.find_last_of(".wgt");
1) + "_tmp.wgt";
}
- _D("decrypted file name : %s", decryptedFile.c_str());
+ LogDebug("decrypted file name : " << decryptedFile);
if (!decryptDRMPackage(source, decryptedFile)) {
- _E("Failed decrypt drm file");
+ LogError("Failed decrypt drm file");
ThrowMsg(Exceptions::DrmDecryptFailed, source);
}
return decryptedFile;
void WidgetUnzip::unzipWgtFile(const std::string &source, const std::string &destination)
{
- _D("Prepare to unzip...");
+ LogDebug("Prepare to unzip...");
std::string wgtFile;
Try
{
wgtFile = getDecryptedPackage(source);
- _D("wgtFile : %s", wgtFile.c_str());
+ LogDebug("wgtFile : " << wgtFile);
m_zip.reset(new DPL::ZipInput(wgtFile));
- _D("Widget package comment: %s", m_zip->GetGlobalComment().c_str());
-
+ LogDebug("Widget package comment: " << m_zip->GetGlobalComment());
// Widget package must not be empty
if (m_zip->empty()) {
m_zip.reset();
// Done
- _D("Unzip finished");
+ LogDebug("Unzip finished");
}
Catch(DPL::ZipInput::Exception::OpenFailed)
{
#include <pkg-manager/pkgmgr_signal.h>
#include <app2ext_interface.h>
#include <dpl/utils/path.h>
-#include <installer_log.h>
using namespace WrtDB;
m_context.installedPath =
DPL::Utils::Path(*dao.getWidgetInstalledPath());
- _D("Widget model exists. App id : %s", m_context.tzAppid.c_str());
+ LogDebug("Widget model exists. App id : " << m_context.tzAppid);
// send start signal of pkgmgr
if (GetInstallerStruct().pkgmgrInterface->setPkgname(m_context.tzPkgid))
{
regex_t regx;
if(regcomp(®x, REG_TIZEN_PKGID_PATTERN, REG_NOSUB | REG_EXTENDED)!=0){
- _D("Regcomp failed");
+ LogDebug("Regcomp failed");
}
std::string pkgId;
DPL::Utils::Path installPath;
TizenAppId appid =
WrtDB::WidgetDAOReadOnly::getTzAppId(
DPL::FromUTF8String(id));
- _D("Get appid from pkgid : %ls", appid.c_str());
+ LogDebug("Get appid from pkgid : " << appid);
m_context.tzAppid = DPL::ToUTF8String(appid);
WrtDB::WidgetDAOReadOnly dao(appid);
installPath = DPL::Utils::Path(*dao.getWidgetInstalledPath());
installPath = DPL::Utils::Path(*dao.getWidgetInstalledPath());
}
if(installPath.isSubPath(PRELOAD_INSTALLED_PATH)){
- _D("This widget is prealoded.");
+ LogDebug("This widget is preloaded.");
}
} Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) {
- _D("package id : %s", pkgId.c_str());
+ LogDebug("package id : " << pkgId);
m_context.tzPkgid = pkgId;
if (!pkgId.empty()) {
if(checkDirectoryExist(pkgId)) {
- _E("installed widget status is abnormal");
+ LogError("installed widget status is abnormal");
return WidgetStatus::ABNORMAL;
}
}
std::ostringstream percent;
percent << static_cast<int>(GetProgressPercent());
- _D("Call widget uninstall progressCallback");
+ LogDebug("Call widget uninstall progressCallback");
GetInstallerStruct().progressCallback(
GetInstallerStruct().userParam,
GetProgressPercent(), GetProgressDescription());
PKGMGR_END_KEY,
PKGMGR_END_SUCCESS);
- _D("Call widget uninstall success finishedCallback");
+ LogDebug("Call widget uninstall success finishedCallback");
GetInstallerStruct().finishedCallback(GetInstallerStruct().userParam,
getRemovedTizenId(),
Jobs::Exceptions::Success);
void JobWidgetUninstall::SendFinishedFailure()
{
using namespace PackageManager;
- _E("Error in uninstallation step: %d", m_exceptionCaught);
- _E("Message: %s", m_exceptionMessage.c_str());
+ LogError("Error in uninstallation step: " << m_exceptionCaught);
+ LogError("Message: " << m_exceptionMessage);
// send signal of pkgmgr
GetInstallerStruct().pkgmgrInterface->sendSignal(
PKGMGR_END_KEY,
PKGMGR_END_FAILURE);
- _D("Call widget uninstall failure finishedCallback");
+ LogDebug("Call widget uninstall failure finishedCallback");
GetInstallerStruct().finishedCallback(GetInstallerStruct().userParam,
getRemovedTizenId(),
m_exceptionCaught);
- _D("[JobWidgetUninstall] Asynchronous failure callback status sent");
+ LogDebug("[JobWidgetUninstall] Asynchronous failure callback status sent");
}
void JobWidgetUninstall::SaveExceptionData(const Jobs::JobExceptionBase &e)
#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
#include <app_manager.h>
-#include <installer_log.h>
namespace Jobs {
namespace WidgetUninstall {
void TaskCheck::StartStep()
{
- _D("--------- <TaskCheck> : START ----------");
+ LogDebug("--------- <TaskCheck> : START ----------");
}
void TaskCheck::EndStep()
{
m_context.job->UpdateProgress(UninstallerContext::UNINSTALL_PRECHECK,
"Uninstall pre-checking Finished");
- _D("--------- <TaskCheck> : END ----------");
+ LogDebug("--------- <TaskCheck> : END ----------");
}
void TaskCheck::StepUninstallPreCheck()
bool isRunning = false;
int ret = app_manager_is_running(m_context.tzAppid.c_str(), &isRunning);
if (APP_MANAGER_ERROR_NONE != ret) {
- _E("Fail to get running state");
+ LogError("Fail to get running state");
ThrowMsg(Exceptions::PlatformAPIFailure,
"Fail to get widget state");
}
app_context_h appCtx = NULL;
ret = app_manager_get_app_context(m_context.tzAppid.c_str(), &appCtx);
if (APP_MANAGER_ERROR_NONE != ret) {
- _E("Fail to get app_context");
+ LogError("Fail to get app_context");
ThrowMsg(Exceptions::AppIsRunning,
"Widget is not stopped. Cannot uninstall!");
}
// terminate app_context_h
ret = app_manager_terminate_app(appCtx);
if (APP_MANAGER_ERROR_NONE != ret) {
- _E("Fail to terminate running application");
+ LogError("Fail to terminate running application");
app_context_destroy(appCtx);
ThrowMsg(Exceptions::AppIsRunning,
"Widget is not stopped. Cannot uninstall!");
nanosleep(&duration, NULL);
int ret = app_manager_is_running(m_context.tzAppid.c_str(), &isStillRunning);
if (APP_MANAGER_ERROR_NONE != ret) {
- _E("Fail to get running state");
+ LogError("Fail to get running state");
ThrowMsg(Exceptions::PlatformAPIFailure,
"Fail to get widget state");
}
}
}
if (isStillRunning) {
- _E("Fail to terminate running application");
+ LogError("Fail to terminate running application");
ThrowMsg(Exceptions::AppIsRunning,
"Widget is not stopped. Cannot uninstall!");
}
- _D("terminate application");
+ LogDebug("terminate application");
}
}
- _D("Widget Can be uninstalled, Pkgname : %s", m_context.tzAppid.c_str());
+ LogDebug("Widget Can be uninstalled. Pkgname : " << m_context.tzAppid);
}
} //namespace WidgetUninstall
} //namespace Jobs
#include <dpl/assert.h>
#include <ace-common/ace_api_common.h>
#include <dpl/wrt-dao-rw/widget_dao.h>
-#include <installer_log.h>
using namespace WrtDB;
tzAppid))));
WidgetDAO::unregisterWidget(DPL::FromUTF8String(m_context.tzAppid));
- _D("Unregistered widget successfully!");
+ LogDebug("Unregistered widget successfully!");
}
Catch(DPL::DB::SqlConnection::Exception::Base)
{
- _E("Failed to handle StepDbUpdate!");
+ LogError("Failed to handle StepDbUpdate!");
ReThrowMsg(Exceptions::DatabaseFailure,
"Failed to handle StepDbUpdate!");
}
web_provider_livebox_delete_by_app_id(m_context.tzAppid.c_str());
if (ret < 0) {
- _D("failed to delete box info");
+ LogDebug("failed to delete box info");
} else {
- _D("delete box info: %s", m_context.tzAppid.c_str());
+ LogDebug("delete box info: " << m_context.tzAppid);
}
}
{
if (!m_context.removeAbnormal) {
WidgetDAO dao(DPL::FromUTF8String(m_context.tzAppid));
- _D("Removing external locations:");
+ LogDebug("Removing external locations:");
WrtDB::ExternalLocationList externalPaths = dao.getWidgetExternalLocations();
FOREACH(file, externalPaths)
{
DPL::Utils::Path path(*file);
if(path.Exists()){
if(path.IsFile()){
- _D(" -> %ls", path.Fullpath().c_str());
+ LogDebug(" -> " << path.Fullpath());
Try{
DPL::Utils::Remove(path);
}Catch(DPL::Utils::Path::BaseException){
- _E("Failed to remove the file: %ls", path.Fullpath().c_str());
+ LogError("Failed to remove the file: " << path.Fullpath());
}
} else if (path.IsDir()){
- _D(" -> %ls", path.Fullpath().c_str());
+ LogDebug(" -> " << path.Fullpath());
Try{
DPL::Utils::Remove(path);
}Catch(DPL::Utils::Path::BaseException){
}
}
}else{
- _W(" -> %ls(no such a path)", path.Fullpath().c_str());
+ LogWarning(" -> " << path.Fullpath() << "(no such a path)");
}
}
dao.unregisterAllExternalLocations();
void TaskDbUpdate::StartStep()
{
- _D("--------- <TaskDbUpdate> : START ----------");
+ LogDebug("--------- <TaskDbUpdate> : START ----------");
}
void TaskDbUpdate::EndStep()
UninstallerContext::UNINSTALL_DB_UPDATE,
"Widget DB Update Finished");
- _D("--------- <TaskDbUpdate> : END ----------");
+ LogDebug("--------- <TaskDbUpdate> : END ----------");
}
} //namespace WidgetUninstall
} //namespace Jobs
#include <dpl/assert.h>
#include <dpl/utils/wrt_utility.h>
#include <dpl/utils/path.h>
-#include <installer_log.h>
namespace Jobs {
namespace WidgetUninstall {
void TaskDeletePkgInfo::StartStep()
{
- _D("--------- <TaskDeletePkgInfo> : START ----------");
+ LogDebug("--------- <TaskDeletePkgInfo> : START ----------");
}
void TaskDeletePkgInfo::EndStep()
{
- _D("--------- <TaskDeletePkgInfo> : END ----------");
+ LogDebug("--------- <TaskDeletePkgInfo> : END ----------");
}
void TaskDeletePkgInfo::StepDeletePkgInfo()
if (0 == (m_context.installedPath.Fullpath()).compare(0,
PRELOAD_INSTALLED_PATH.Fullpath().length(),
PRELOAD_INSTALLED_PATH.Fullpath())) {
- _D("This widget is preloaded.");
+ LogDebug("This widget is preloaded.");
destFile = USR_PACKAGES_PATH;
} else {
destFile = OPT_PACKAGES_PATH;
if (!(destFile.Exists() == 0 && pre_manifest.Exists())) {
if (0 != pkgmgr_parser_parse_manifest_for_uninstallation(
destFile.Fullpath().c_str(), NULL)) {
- _W("Manifest file failed to parse for uninstallation");
+ LogWarning("Manifest file failed to parse for uninstallation");
}
}
if (!DPL::Utils::TryRemove(destFile)) {
- _W("No manifest file found: %s", destFile.Fullpath().c_str());
+ LogWarning("No manifest file found: " << destFile.Fullpath());
} else {
- _D("Manifest file removed: %s", destFile.Fullpath().c_str());
+ LogDebug("Manifest file removed: " << destFile.Fullpath());
}
}
} //namespace WidgetUninstall
#include <widget_uninstall/task_remove_custom_handlers.h>
#include <widget_uninstall/uninstaller_context.h>
+#include <dpl/log/log.h>
#include <dpl/optional_typedefs.h>
#include <appsvc.h>
#include <wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h>
#include <wrt-commons/custom-handler-dao-rw/custom_handler_dao.h>
-#include <installer_log.h>
namespace Jobs {
namespace WidgetUninstall {
void TaskRemoveCustomHandlers::Step()
{
- _D("Removing widget from appsvc");
+ LogDebug("Removing widget from appsvc");
int result = appsvc_unset_defapp(m_context.tzAppid.c_str());
- _D("Result: %d", result);
+ LogDebug("Result: " << result);
CustomHandlerDB::Interface::attachDatabaseRW();
CustomHandlerDB::CustomHandlerDAO handlersDao(
void TaskRemoveCustomHandlers::StartStep()
{
- _D("--------- <TaskRemoveCustomHandlers> : START ----------");
+ LogDebug("--------- <TaskRemoveCustomHandlers> : START ----------");
}
void TaskRemoveCustomHandlers::EndStep()
{
- _D("--------- <TaskRemoveCustomHandlers> : END ----------");
+ LogDebug("--------- <TaskRemoveCustomHandlers> : END ----------");
}
} //namespace WidgetUninstall
} //namespace Jobs
#include <errno.h>
#include <string.h>
#include <widget_install_to_external.h>
-#include <installer_log.h>
namespace Jobs {
namespace WidgetUninstall {
void TaskRemoveFiles::StepRemoveInstallationDirectory()
{
- _D("StepRemoveInstallationDirectory started");
+ LogDebug("StepRemoveInstallationDirectory started");
Try {
int ret = app2ext_get_app_location(m_context.tzPkgid.c_str());
if (APP2EXT_INTERNAL_MEM == ret) {
- _D("Removing directory");
+ LogDebug("Removing directory");
m_context.removeStarted = true;
DPL::Utils::Path widgetDir= m_context.installedPath;
Try{
DPL::Utils::Remove(widgetDir);
} Catch(DPL::Utils::Path::BaseException){
- _E("Removing widget installation directory failed : %ls", widgetDir.Fullpath().c_str());
+ LogError("Removing widget installation directory failed : " <<
+ widgetDir.Fullpath());
}
DPL::Utils::Path dataDir(m_context.locations->getUserDataRootDir());
Try{
DPL::Utils::Remove(dataDir);
} Catch(DPL::Utils::Path::BaseException){
- _W("%ls is already removed", dataDir.Fullpath().c_str());
+ LogWarning(dataDir.Fullpath() << " is already removed");
}
} else if (APP2EXT_SD_CARD == ret) {
- _D("Removing sdcard directory");
+ LogDebug("Removing sdcard directory");
Try {
WidgetInstallToExtSingleton::Instance().initialize(m_context.tzPkgid);
WidgetInstallToExtSingleton::Instance().uninstallation();
RemoveFilesFailed);
}
} else {
- _E("app is not installed");
+ LogError("app is not installed");
ThrowMsg(Exceptions::WidgetNotExist, "failed to get app location");
}
} Catch(Exception::RemoveFilesFailed) {
void TaskRemoveFiles::StepRemoveFinished()
{
- _D("StepRemoveFinished finished");
+ LogDebug("StepRemoveFinished finished");
m_context.job->UpdateProgress(
UninstallerContext::UNINSTALL_REMOVE_FINISHED,
void TaskRemoveFiles::StartStep()
{
- _D("--------- <TaskRemoveFiles> : START ----------");
+ LogDebug("--------- <TaskRemoveFiles> : START ----------");
}
void TaskRemoveFiles::EndStep()
{
- _D("--------- <TaskRemoveFiles> : END ----------");
+ LogDebug("--------- <TaskRemoveFiles> : END ----------");
}
} //namespace WidgetUninstall
} //namespace Jobs
#include <widget_uninstall/task_smack.h>
#include <widget_uninstall/job_widget_uninstall.h>
#include <widget_uninstall/uninstaller_context.h>
+#include <dpl/log/log.h>
#include <dpl/optional_typedefs.h>
-#include <installer_log.h>
-
#ifdef WRT_SMACK_ENABLED
#include <privilege-control.h>
#endif
void TaskSmack::Step()
{
- _D("------------------------> SMACK: Jobs::WidgetUninstall::TaskSmack::Step()");
+ LogDebug(
+ "------------------------> SMACK: Jobs::WidgetUninstall::TaskSmack::Step()");
#ifdef WRT_SMACK_ENABLED
const char* pkgId = m_context.tzPkgid.c_str();
if (PC_OPERATION_SUCCESS != perm_app_revoke_permissions(pkgId)) {
- _E("failure in revoking smack permissions");
+ LogError("failure in revoking smack permissions");
}
if (PC_OPERATION_SUCCESS != perm_app_uninstall(pkgId)) {
- _E("failure in removing smack rules file");
+ LogError("failure in removing smack rules file");
}
#endif
}
void TaskSmack::StartStep()
{
- _D("--------- <TaskSmack> : START ----------");
+ LogDebug("--------- <TaskSmack> : START ----------");
}
void TaskSmack::EndStep()
UninstallerContext::UNINSTALL_SMACK_DISABLE,
"Widget SMACK Disabled");
- _D("--------- <TaskSmack> : END ----------");
+ LogDebug("--------- <TaskSmack> : END ----------");
}
} //namespace WidgetUninstall
} //namespace Jobs
#include <widget_uninstall/widget_uninstall_errors.h>
#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
-#include <installer_log.h>
using namespace WrtDB;
void TaskUninstallOspsvc::StepUninstallOspsvc()
{
- _D("Step : Uninstall Osp service");
+ LogDebug("Step : Uninstall Osp service ");
std::ostringstream commStr;
commStr << OSP_INSTALL_STR << BashUtils::escape_arg(m_context.tzPkgid);
- _D("osp uninstall command : %s", commStr.str().c_str());
+ LogDebug("osp uninstall command : " << commStr.str());
char readBuf[MAX_BUF_SIZE];
FILE *fd;
fd = popen(commStr.str().c_str(), "r");
if (NULL == fd) {
- _E("Failed to uninstalltion osp service");
+ LogError("Failed to uninstalltion osp service");
ThrowMsg(Exceptions::UninstallOspSvcFailed,
"Error occurs during\
uninstall osp service");
if(fgets(readBuf, MAX_BUF_SIZE, fd) == NULL)
{
- _E("Failed to uninstalltion osp service\
+ LogError("Failed to uninstalltion osp service\
Inability of reading file.");
ThrowMsg(Exceptions::UninstallOspSvcFailed,
"Error occurs during\
uninstall osp service");
}
- _D("return value : %s", readBuf);
+ LogDebug("return value : " << readBuf);
int result = atoi(readBuf);
if (0 != result) {
pclose(fd);
- _D("Widget Can be uninstalled. Pkgname : %s", m_context.tzPkgid.c_str());
+ LogDebug("Widget Can be uninstalled. Pkgname : " << m_context.tzPkgid);
m_context.job->UpdateProgress(UninstallerContext::UNINSTALL_REMOVE_OSPSVC,
"Uninstall OSP service finished");
}
void TaskUninstallOspsvc::StartStep()
{
- _D("--------- <TaskUninstallOspsvc> : START ----------");
+ LogDebug("--------- <TaskUninstallOspsvc> : START ----------");
}
void TaskUninstallOspsvc::EndStep()
{
- _D("--------- <TaskUninstallOspsvc> : END ----------");
+ LogDebug("--------- <TaskUninstallOspsvc> : END ----------");
}
} //namespace WidgetUninstall
} //namespace Jobs
* limitations under the License.
*/
#include "installer_controller.h"
+#include <dpl/log/log.h>
#include <dpl/singleton_impl.h>
IMPLEMENT_SINGLETON(Logic::InstallerController)
#include <plugin_install/job_plugin_install.h>
#include <job_exception_base.h>
#include <plugin_install/plugin_objects.h>
-#include <installer_log.h>
using namespace WrtDB;
void InstallerLogic::Initialize()
{
- _D("Done");
+ LogDebug("Done");
}
void InstallerLogic::Terminate()
if(m_job)
m_job->SetPaused(true);
- _D("Done");
+ LogDebug("Done");
}
Jobs::JobHandle InstallerLogic::AddAndStartJob()
{
if(m_job)
{
- _E("Job is in progress. It is impossible to add new job");
+ LogError("Job is in progress. It is impossible to add new job");
return -1;
}
- _D("New Widget Installation:");
+ LogDebug("New Widget Installation:");
m_job =
new Jobs::WidgetInstall::JobWidgetInstall(widgetPath, installerStruct);
{
if(m_job)
{
- _E("Job is in progress. It is impossible to add new job");
+ LogError("Job is in progress. It is impossible to add new job");
return -1;
}
- _D("New Widget Uninstallation");
+ LogDebug("New Widget Uninstallation");
m_job =
new Jobs::WidgetUninstall::JobWidgetUninstall(widgetPkgName,
{
if(m_job)
{
- _E("Job is in progress. It is impossible to add new job");
+ LogError("Job is in progress. It is impossible to add new job");
return -1;
}
- _D("New Plugin Installation");
+ LogDebug("New Plugin Installation");
// TODO Conversion to PluginPath is temporary
m_job =
return false;
} catch (Jobs::JobExceptionBase &exc) {
//start revert job
- _D("Exception occured: %d. Reverting job...", exc.getParam());
+ LogDebug("Exception occured: " << exc.getParam() <<
+ ". Reverting job...");
bool hasAbortSteps = job->Abort();
job->SetAbortStarted(true);
job->SaveExceptionData(exc);
if (depHandle ==
Jobs::PluginInstall::JobPluginInstall::INVALID_HANDLE)
{
- _E("Library implementing: %ls NOT FOUND", (*requiredObject).c_str());
+ LogError("Library implementing: " <<
+ *requiredObject << " NOT FOUND");
//PluginDAO::SetPluginInstallationStatus(INSTALLATION_WAITING);
return false;
#include <dpl/noncopyable.h>
#include <dpl/string.h>
#include <dpl/foreach.h>
+#include <dpl/log/log.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
#include <dpl/wrt-dao-ro/global_dao_read_only.h>
-#include <installer_log.h>
namespace Jobs {
namespace WidgetInstall {
WrtDB::WidgetDAOReadOnly widgetDao(tzAppid);
WidgetFeatureSet featureSet = widgetDao.getFeaturesList();
FOREACH(it, featureSet) {
- _D("Feature name : %ls", it->name.c_str());
+ LogDebug("Feature name : " << it->name);
WrtDB::DeviceCapabilitySet dcs;
if (!DPL::StringCompare(it->name, PRIVILEGE_TESTAUTOMATION)) {
// special privilege
dcs = WrtDB::GlobalDAOReadOnly::GetDeviceCapability(it->name);
}
FOREACH(devCap, dcs) {
- _D("--- dev cap : %ls", (*devCap).c_str());
+ LogDebug("--- dev cap : " << *devCap);
}
Feature feature(*it, dcs);
m_featureList.push_back(feature);
#include "libxml_utils.h"
#include <dpl/singleton_impl.h>
-#include <installer_log.h>
IMPLEMENT_SINGLETON(LibxmlUtils)
LibxmlUtils::~LibxmlUtils()
{
if (isInitialized) {
- _D("Libxml - cleaning");
+ LogDebug("Libxml - cleaning");
// Cleanup function for the XML library.
xmlCleanupParser();
//this is to debug memory for regression tests
if (!isInitialized) {
LIBXML_TEST_VERSION
isInitialized = true;
- _D("Libxml have been initialized");
+ LogDebug("Libxml have been initialized");
}
- _D("Libxml already initialized");
+ LogDebug("Libxml already initialized");
}
#include <memory>
#include <string>
+#include <dpl/log/log.h>
#include <dpl/string.h>
#include <iri.h>
-#include <installer_log.h>
namespace {
const char *SCHEME_HTTP = "http";
bool WacWidgetId::matchHost(const DPL::String &second) const
{
- _D("m_schemaMatch is: %s", m_schemaMatch);
+ LogDebug("m_schemaMatch is: " << m_schemaMatch);
if (!m_schemaMatch) {
return false;
}
- _D("Matching DNS identity: %s %s", m_host.c_str(), DPL::ToUTF8String(second).c_str());
+ LogDebug("Matching DNS identity: " << m_host <<
+ " " << DPL::ToUTF8String(second));
return m_host == DPL::ToUTF8String(second);
}
void WacWidgetId::parse(const char *url)
{
- _D("Widget id to parse: %s", url);
+ LogDebug("Widget id to parse: " << url);
std::unique_ptr<iri_struct, std::function<void(iri_struct*)> >
iri(iri_parse(url), iri_destroy);
if (!iri.get()) {
- _E("Error in parsing widget id.");
+ LogError("Error in parsing widget id.");
return; // m_schemaMatch == false;
}
if (iri.get()->scheme) {
scheme = iri.get()->scheme;
} else {
- _W("Error. No scheme in widget id.");
+ LogWarning("Error. No scheme in widget id.");
return; // m_schemaMatch == false;
}
// We only match "http" and "https" schemas
if ((scheme != SCHEME_HTTP) && (scheme != SCHEME_HTTPS)) {
- _W("Unknown scheme in widget id. %s", scheme.c_str());
+ LogWarning("Unknown scheme in widget id." << scheme);
return; // m_schemaMatch == false;
} else {
m_schemaMatch = true;
if (iri.get()->host) {
m_host = iri.get()->host;
- _D("Host has been set to: %s", m_host.c_str());
+ LogDebug("Host has been set to: " << m_host);
}
// What to do when host is empty? No info in wac documentation.
#include <dpl/singleton_safe_impl.h>
#include <dpl/assert.h>
-#include <installer_log.h>
+#include <dpl/log/log.h>
IMPLEMENT_SAFE_SINGLETON(WidgetInstallToExt)
void WidgetInstallToExt::initialize(std::string appId)
{
- _D("WidgetInstallToExt::initialize()");
+ LogDebug("WidgetInstallToExt::initialize()");
m_appId = appId;
m_handle = app2ext_init(APP2EXT_SD_CARD);
void WidgetInstallToExt::deinitialize()
{
- _D("WidgetInstallToExt::deinitialize()");
+ LogDebug("WidgetInstallToExt::deinitialize()");
if (NULL != m_handle) {
if (0 < app2ext_deinit(m_handle)) {
ThrowMsg(Exception::ErrorInstallToExt,
void WidgetInstallToExt::preInstallation(GList *dirList, int dSize)
{
- _D("WidgetInstallToExt::preInstallation()");
+ LogDebug("WidgetInstallToExt::preInstallation()");
Assert(m_handle);
int ret = m_handle->interface.pre_install(m_appId.c_str(), dirList, dSize);
if (APP2EXT_SUCCESS == ret) {
- _D("App2Ext pre install success");
+ LogDebug("App2Ext pre install success");
} else {
postInstallation(false);
ThrowMsg(Exception::ErrorInstallToExt, "pre-install failed");
void WidgetInstallToExt::postInstallation(bool status)
{
- _D("WidgetInstallToExt::postInstallation()");
+ LogDebug("WidgetInstallToExt::postInstallation()");
if (NULL != m_handle) {
if (status) {
void WidgetInstallToExt::preUpgrade(GList *dirList, int dSize)
{
- _D("WidgetInstallToExt::preUpgrade()");
+ LogDebug("WidgetInstallToExt::preUpgrade()");
Assert(m_handle);
int ret = m_handle->interface.pre_upgrade(m_appId.c_str(), dirList, dSize);
if (APP2EXT_SUCCESS == ret) {
- _D("App2Ext pre-upgrade success");
+ LogDebug("App2Ext pre-upgrade success");
} else {
postUpgrade(false);
ThrowMsg(Exception::ErrorInstallToExt, "pre-upgrade failed");
void WidgetInstallToExt::postUpgrade(bool status)
{
- _D("WidgetInstallToExt::postUpgrade()");
+ LogDebug("WidgetInstallToExt::postUpgrade()");
if (NULL != m_handle) {
if (status) {
m_handle->interface.post_upgrade(m_appId.c_str(),
void WidgetInstallToExt::uninstallation()
{
- _D("WidgetInstallToExt::uninstallation()");
+ LogDebug("WidgetInstallToExt::uninstallation()");
Assert(m_handle);
if (APP2EXT_SUCCESS ==
m_handle->interface.post_uninstall(m_appId.c_str()))
{
- _D("App2Ext pre-uninstall success");
+ LogDebug("App2Ext pre-uninstall success");
} else {
ThrowMsg(Exception::ErrorInstallToExt, "post-uninstall failed");
}
#include <dpl/utils/wrt_utility.h>
#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/assert.h>
+#include <dpl/log/log.h>
#include <dpl/sstream.h>
#include <dpl/localization/localization_utils.h>
#include <widget_install/task_commons.h>
-#include <installer_log.h>
WidgetLocation::DirectoryDeletor::DirectoryDeletor(bool isReadOnly) :
m_dirpath(Jobs::WidgetInstall::createTempPath(isReadOnly))
WidgetLocation::DirectoryDeletor::~DirectoryDeletor()
{
- _D("Removing widget installation temporary directory: %s", m_dirpath.c_str());
+ LogDebug(
+ "Removing widget installation temporary directory: " << m_dirpath.c_str());
if (!WrtUtilRemove(m_dirpath)) {
- _W("Fail at removing directory: %s", m_dirpath.c_str());
+ LogWarning("Fail at removing directory: " << m_dirpath.c_str());
}
}
std::string WidgetLocation::getBackupSharedTrustedDir() const
{
return getBackupSharedDir() + "/trusted";
-}
+}
\ No newline at end of file
#include "package-manager-plugin.h"
#include <package-manager.h>
#include <regex.h>
+#include <dlog.h>
#include <dpl/wrt-dao-ro/global_config.h>
#include <vcore/VCore.h>
#include <dpl/wrt-dao-ro/WrtDatabase.h>
#include <dpl/wrt-dao-ro/widget_config.h>
#include <string>
#include <dpl/db/sql_connection.h>
+#include <dpl/log/log.h>
#include <dpl/foreach.h>
#include <dpl/utils/folder_size.h>
#include <dpl/wrt-dao-ro/wrt_db_types.h>
#include "root_parser.h"
#include "widget_parser.h"
#include "parser_runner.h"
-#include <installer_log.h>
using namespace WrtDB;
static void pkg_native_plugin_on_unload()
{
- _D("pkg_native_plugin_unload() is called");
+ LogDebug("pkg_native_plugin_unload() is called");
}
static int pkg_plugin_app_is_installed(const char *pkg_name)
{
const char* REG_PKGID_PATTERN = "^[a-zA-Z0-9]{10}$";
- _D("pkg_plugin_app_is_installed() is called");
+ LogDebug("pkg_plugin_app_is_installed() is called");
WrtDB::WrtDatabase::attachToThreadRO();
regex_t reg;
if (regcomp(®, REG_PKGID_PATTERN, REG_NOSUB | REG_EXTENDED) != 0) {
- _D("Regcomp failed");
+ LogDebug("Regcomp failed");
}
WrtDB::TizenAppId appid;
if (!(regexec(®, pkg_name,
static_cast<size_t>(0), NULL, 0) == 0))
{
- _E("Invalid argument : %s", pkg_name);
+ LogError("Invalid argument : " << pkg_name);
return FALSE;
}
Try {
WrtDB::TizenPkgId pkgid(DPL::FromUTF8String(pkg_name));
appid = WidgetDAOReadOnly::getTzAppId(pkgid);
- _D("appid : %s", appid.c_str());
+ LogDebug("appid : " << appid);
} Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) {
WrtDB::WrtDatabase::detachFromThread();
return FALSE;
package_manager_pkg_info_t **list,
int *count)
{
- _D("pkg_plugin_get_installed_apps_list() is called");
+ LogDebug("pkg_plugin_get_installed_apps_list() is called");
package_manager_pkg_info_t *pkg_list = NULL;
package_manager_pkg_info_t *pkg_last = NULL;
package_manager_pkg_detail_info_t *
pkg_detail_info)
{
- _D("pkg_plugin_get_app_detail_info() is called");
+ LogDebug("pkg_plugin_get_app_detail_info() is called");
WrtDB::WrtDatabase::attachToThreadRO();
Try {
WrtDB::TizenPkgId pkgid(DPL::FromUTF8String(pkg_name));
appid = WidgetDAOReadOnly::getTzAppId(pkgid);
- _D("appid : %s", appid.c_str());
+ LogDebug("appid : " << appid);
} Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) {
WrtDB::WrtDatabase::detachFromThread();
return FALSE;
WidgetLocalizedInfo localizedInfo;
if (locale.IsNull()) {
- _D("locale is NULL");
+ LogDebug("locale is NULL");
DPL::String languageTag(L"");
localizedInfo = widget.getLocalizedInfo(languageTag);
} else {
}
Catch(DPL::ZipInput::Exception::OpenFailed)
{
- _E("Failed to open widget package");
+ LogError("Failed to open widget package");
return FALSE;
}
Catch(DPL::ZipInput::Exception::OpenFileFailed)
{
- _E("Failed to open config.xml file");
+ LogError("Failed to open config.xml file");
return FALSE;
}
Catch(DPL::CopyFailed)
{
- _E("Failed to extract config.xml file");
+ LogError("Failed to extract config.xml file");
return FALSE;
}
Catch(DPL::FileInput::Exception::OpenFailed)
{
- _E("Failed to open config.xml file");
+ LogError("Failed to open config.xml file");
return FALSE;
}
Catch(ElementParser::Exception::ParseError)
{
- _E("Failed to parse config.xml file");
+ LogError("Failed to parse config.xml file");
return FALSE;
}
Catch(DPL::ZipInput::Exception::SeekFileFailed)
{
- _E("Failed to seek widget archive - corrupted package?");
+ LogError("Failed to seek widget archive - corrupted package?");
return FALSE;
}
}
Catch(DPL::ZipInput::Exception::OpenFileFailed)
{
- _D("This web app is hybrid web app");
+ LogDebug("This web app is hybrid web app");
std::string hybrid_icon = "res/wgt/" + icon_name;
iconFile.reset(zipFile->OpenFile(hybrid_icon));
}
}
Catch(DPL::ZipInput::Exception::OpenFailed)
{
- _D("Failed to open widget package");
+ LogDebug("Failed to open widget package");
return NULL;
}
Catch(DPL::ZipInput::Exception::OpenFileFailed)
{
- _D("Not found icon file %s", icon_name.c_str());
+ LogDebug("Not found icon file " << icon_name);
return NULL;
}
}
pkg_detail_info->privilege_list = NULL;
FOREACH(it, configInfo.featuresList) {
std::string featureInfo = DPL::ToUTF8String(it->name);
- _D("privilege : %s", featureInfo.c_str());
+ LogDebug("privilege : " << featureInfo);
int length = featureInfo.size();
char *privilege = (char*) calloc(1, (sizeof(char) * (length + 1)));
snprintf(privilege, length + 1, "%s", featureInfo.c_str());
char* icon_buf = getIcon(widget_path, configInfo, pkg_detail_info->icon_size);
if (icon_buf) {
- _D("icon size : %d", pkg_detail_info->icon_size);
+ LogDebug("icon size : " << pkg_detail_info->icon_size);
pkg_detail_info->icon_buf = icon_buf;
} else {
- _D("No icon");
+ LogDebug("No icon");
pkg_detail_info->icon_size = 0;
pkg_detail_info->icon_buf = NULL;
}
const char * pkg_path,
package_manager_pkg_detail_info_t * pkg_detail_info)
{
- _D("pkg_plugin_get_app_detail_info_from_package() is called");
+ LogDebug("pkg_plugin_get_app_detail_info_from_package() is called");
return getWidgetDetailInfoFromPackage(pkg_path, pkg_detail_info);
}
pkgmgr_info *pkgmgr_client_check_pkginfo_from_file(const char *pkg_path)
{
- _D("pkgmgr_client_check_pkginfo_from_file() is called");
+ LogDebug("pkgmgr_client_check_pkginfo_from_file() is called");
package_manager_pkg_detail_info_t *pkg_detail_info;
pkg_detail_info = (package_manager_pkg_detail_info_t*)malloc(
sizeof(package_manager_pkg_detail_info_t));
int ret = getWidgetDetailInfoFromPackage(pkg_path, pkg_detail_info);
if (FALSE == ret) {
- _E("Failed to get package detail info ");
+ LogError("Failed to get package detail info ");
return NULL;
}
return reinterpret_cast<pkgmgr_info*>(pkg_detail_info);
* @brief
*/
+#include <dpl/log/log.h>
#include <pkgmgr_installer.h>
#include <pkg-manager/pkgmgr_signal.h>
-#include <installer_log.h>
namespace PackageManager {
PkgmgrSignal::PkgmgrSignal() :
bool PkgmgrSignal::initialize(int argc, char* argv[])
{
if (m_handle) {
- _D("Release already allocated pkgmgr handle");
+ LogDebug("Release already allocated pkgmgr handle");
pkgmgr_installer_free(m_handle);
m_handle = NULL;
}
m_handle = pkgmgr_installer_new();
if (!m_handle) {
- _E("Fail to get pkgmgr installer handle");
+ LogError("Fail to get pkgmgr installer handle");
return false;
}
m_reqType != PKGMGR_REQ_UNINSTALL &&
m_reqType != PKGMGR_REQ_REINSTALL)
{
- _E("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;
m_callerId = callerId;
} else {
- _E("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;
bool PkgmgrSignal::deinitialize()
{
if (!m_initialized) {
- _E("PkgmgrSingal not yet intialized");
+ LogError("PkgmgrSingal not yet intialized");
return false;
}
bool PkgmgrSignal::setPkgname(const std::string& name)
{
if (!m_initialized) {
- _E("PkgmgrSingal not yet intialized");
+ LogError("PkgmgrSingal not yet intialized");
return false;
}
if (name.empty()) {
- _E("name is empty");
+ LogError("name is empty");
return false;
}
m_pkgname = name;
- _D("Success to set tizen package name: %s", m_pkgname.c_str());
+ LogDebug("Success to set tizen package name: " << m_pkgname);
return true;
}
const std::string& value) const
{
if (!m_initialized) {
- _E("PkgmgrSingal not yet intialized");
+ LogError("PkgmgrSingal not yet intialized");
return false;
}
if (key.empty() || value.empty()) {
- _D("key or value is empty");
+ LogDebug("key or value is empty");
return false;
}
if (m_handle == NULL || m_type.empty()) {
- _E("Some data of PkgmgrSignal is empty");
+ LogError("Some data of PkgmgrSignal is empty");
return false;
}
m_handle, m_type.c_str(), m_pkgname.c_str(),
key.c_str(), value.c_str()))
{
- _E("Fail to send pkgmgr signal");
+ LogError("Fail to send pkgmgr signal");
return false;
}
- _D("Success to send pkgmgr signal: %s - %s", key.c_str(), value.c_str());
+ LogDebug("Success to send pkgmgr signal: " << key <<
+ " - " << value);
return true;
}
std::string PkgmgrSignal::getPkgname() const
{
if (!m_initialized) {
- _E("PkgmgrSingal not yet intialized");
+ LogError("PkgmgrSingal not yet intialized");
}
return m_pkgname;
int PkgmgrSignal::getRequestedType() const
{
if (!m_initialized) {
- _E("PkgmgrSingal not yet intialized");
+ LogError("PkgmgrSingal not yet intialized");
}
return m_reqType;
std::string PkgmgrSignal::getCallerId() const
{
if (!m_initialized) {
- _E("PkgmgrSingal not yet intialized");
+ LogError("PkgmgrSingal not yet intialized");
}
return m_callerId;
*/
#include <installer_callbacks_translate.h>
-#include <dpl/assert.h>
-#include <installer_log.h>
+#include <dpl/log/log.h>
namespace InstallerCallbacksTranslate {
// Callback
apiStr->status_callback(tizenId, errorStatus, apiStr->userdata);
} else {
- _D("installFinishedCallback: No callback");
+ LogDebug("installFinishedCallback: No callback");
}
}
// Callback
apiStr->status_callback(tizenId, errorStatus, apiStr->userdata);
} else {
- _D("uninstallFinishedCallback: No callback");
+ LogDebug("uninstallFinishedCallback: No callback");
}
}
apiStr->statusCallback(errorStatus, apiStr->userdata);
} else {
- _D("PluginInstallFinishedCallback: No callback");
+ LogDebug("PluginInstallFinishedCallback: No callback");
}
delete apiStr;
if (apiStr->progress_callback) {
//CALLBACK EXEC
- _D("Entered %2.0f% %s", percent, description.c_str());
+ LogPedantic("Entered " << percent << "% " << description);
apiStr->progress_callback(static_cast<float>(percent),
description.c_str(),
apiStr->userdata);
} else {
- _D("installProgressCallback: ignoring NULL callback pointer");
+ LogPedantic("installProgressCallback: ignoring NULL callback pointer");
}
}
} //namespace
* @version 1.0
*/
#include <language_subtag_rst_tree.h>
+#include <dpl/log/log.h>
#include <dpl/db/orm.h>
#include <dpl/string.h>
#include <dpl/scope_guard.h>
#include <vector>
#include <ctype.h>
#include <dpl/singleton_impl.h>
-#include <installer_log.h>
-
IMPLEMENT_SINGLETON(LanguageSubtagRstTree)
namespace I18nDAOReadOnly = I18n::DB::I18nDAOReadOnly;
#define TEST_LANG(str, cond) \
if (LanguageSubtagRstTreeSingleton::Instance(). \
ValidateLanguageTag(str) == cond) { \
- _D("Good validate status for lang: %s", str); \
+ LogDebug("Good validate status for lang: " << str); \
} else { \
- _E("Wrong validate status for lang: %s, should be %s", str, cond); \
+ LogError("Wrong validate status for lang: " << str \
+ << ", should be " << cond); \
}
void LanguageSubtagRstTree::Initialize()
#include <unistd.h>
#include "plugin_utils.h"
#include <dpl/exception.h>
+#include <dpl/log/log.h>
#include <dpl/wrt-dao-ro/global_config.h>
#include <sys/file.h>
-#include <installer_log.h>
using namespace WrtDB;
int ret = 0;
- _D("Try to lock for plugins installation.");
+ LogDebug("Try to lock for plugins installation.");
s_plugin_install_lock_fd =
open(PLUGIN_INSTALL_LOCK_FILE, O_RDONLY | O_CREAT, 0666);
if (s_plugin_install_lock_fd == -1) {
- _E("Lock file open failed!");
+ LogError("Lock file open failed!");
return false;
}
ret = flock(s_plugin_install_lock_fd, LOCK_EX); //lock with waiting
if (ret == -1) {
- _E("Lock failed!");
+ LogError("Lock failed!");
close(s_plugin_install_lock_fd);
s_plugin_install_lock_fd = -1;
bool unlockPluginInstallation(bool isPreload)
{
- _D("Unlock for plugins installation.");
+ LogDebug("Unlock for plugins installation.");
if (isPreload) {
fprintf(stderr, "Skip plugin unlock.. \n");
return true;
ret = flock(s_plugin_install_lock_fd, LOCK_UN); //unlock
if (ret == -1) {
- _E("Unlock failed!");
+ LogError("Unlock failed!");
}
close(s_plugin_install_lock_fd);
return true;
} else {
- _E("Lock file was not created!");
+ LogError("Lock file was not created!");
}
return false;
case FileState::FILE_NOT_EXISTS:
return false;
default:
- _W("Opening installation request file failed");
+ LogWarning("Opening installation request file failed");
return false;
}
}
#include <dirent.h>
#include <sys/resource.h>
+#include <dpl/log/log.h>
#include <dpl/optional_typedefs.h>
#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/wrt-dao-ro/config_parser_data.h>
#include <pkg-manager/pkgmgr_signal_dummy.h>
#include <pkg-manager/pkgmgr_signal.h>
-#include <installer_log.h>
using namespace WrtDB;
m_startupPluginInstallation(false)
{
Touch();
- _D("App Created");
+ LogDebug("App Created");
}
WrtInstaller::~WrtInstaller()
{
- _D("App Finished");
+ LogDebug("App Finished");
}
int WrtInstaller::getReturnStatus() const
void WrtInstaller::OnStop()
{
- _D("Stopping Dummy Client");
+ LogDebug("Stopping Dummy Client");
}
void WrtInstaller::OnCreate()
{
- _D("Creating DummyClient");
+ LogDebug("Creating DummyClient");
showArguments();
AddStep(&WrtInstaller::initStep);
if (!m_startupPluginInstallation) {
AddStep(&WrtInstaller::installPluginsStep);
} else {
- _D("Plugin installation alredy started");
+ LogDebug("Plugin installation alredy started");
}
} else if (arg == "-i" || arg == "--install") {
if (m_argc != 3) {
struct stat info;
if (-1 != stat(m_argv[2], &info) && S_ISDIR(info.st_mode)) {
- _D("Installing package directly from directory");
+ LogDebug("Installing package directly from directory");
m_installMode.extension = InstallMode::ExtensionType::DIR;
} else {
- _D("Installing from regular location");
+ LogDebug("Installing from regular location");
m_installMode.extension = InstallMode::ExtensionType::WGT;
}
m_packagePath = m_argv[2];
AddStep(&WrtInstaller::installStep);
} else if (arg == "-ip" || arg == "--install-preload") {
- _D("Install preload web app");
+ LogDebug("Install preload web app");
if (m_argc != 3) {
return showHelpAndQuit();
}
m_installMode.rootPath = InstallMode::RootPath::RO;
AddStep(&WrtInstaller::installStep);
} else if (arg == "-ipw" || arg == "--install-preload-writable") {
- _D("Install preload web application to writable storage");
+ LogDebug("Install preload web application to writable storage");
if (m_argc != 3) {
return showHelpAndQuit();
}
AddStep(&WrtInstaller::installStep);
} else if (arg == "-c" || arg == "--csc-update") {
// "path=/opt/system/csc/Ozq2iEG15R-2.0.0-arm.wgt:op=install:removable=true"
- _D("Install & uninstall by csc configuration");
+ LogDebug("Install & uninstall by csc configuration");
if (m_argc != 3) {
return showHelpAndQuit();
}
}
if (it->second == CSCConfiguration::VALUE_INSTALL) {
- _D("operation = %s", it->second.c_str());
+ LogDebug("operation = " << it->second);
m_installMode.extension = InstallMode::ExtensionType::WGT;
it = m_CSCconfigurationMap.find(CSCConfiguration::KEY_PATH);
if (it == m_CSCconfigurationMap.end()) {
? false : true;
AddStep(&WrtInstaller::installStep);
- _D("path = %s", m_packagePath.c_str());
+ LogDebug("path = " << m_packagePath);
} else if (it->second == CSCConfiguration::VALUE_UNINSTALL) {
- _D("operation = %s", it->second.c_str());
+ LogDebug("operation = " << it->second);
// uninstall command isn't confirmed yet
it = m_CSCconfigurationMap.find(CSCConfiguration::KEY_PATH);
if (it == m_CSCconfigurationMap.end()) {
}
m_packagePath = it->second;
AddStep(&WrtInstaller::unistallWgtFileStep);
- _D("operation = uninstall");
- _D("path = %s", m_packagePath.c_str());
+ LogDebug("operation = uninstall");
+ LogDebug("path = " << m_packagePath);
} else {
- _E("Unknown operation : %s", it->second.c_str());
- _D("operation = %s", it->second.c_str());
+ LogError("Unknown operation : " << it->second);
+ LogDebug("operation = " << it->second);
return showHelpAndQuit();
}
} else if (arg == "-un" || arg == "--uninstall-name") {
if (m_argc != 3) {
return showHelpAndQuit();
}
- _D("Installing package directly from directory");
+ LogDebug("Installing package directly from directory");
m_installMode.command = InstallMode::Command::REINSTALL;
m_installMode.extension = InstallMode::ExtensionType::DIR;
m_packagePath = m_argv[2];
m_packagePath = m_argv[4];
struct stat info;
if (-1 != stat(m_argv[4], &info) && S_ISDIR(info.st_mode)) {
- _D("Installing package directly from directory");
+ LogDebug("Installing package directly from directory");
m_installMode.extension = InstallMode::ExtensionType::DIR;
} else {
- _D("Installing from regular location");
+ LogDebug("Installing from regular location");
m_installMode.extension = InstallMode::ExtensionType::WGT;
}
AddStep(&WrtInstaller::installStep);
if (0 == pkgmgrinfo_pkginfo_get_pkginfo(m_name.c_str(), &handle)) {
if (0 > pkgmgrinfo_pkginfo_is_system(handle, &system_app)) {
- _E("Can't get package information : %s", m_name.c_str());
+ LogError("Can't get package information : " << m_name);
}
if (0 > pkgmgrinfo_pkginfo_is_update(handle, &update)) {
- _E("Can't get package information about update : %s", m_name.c_str());
+ LogError("Can't get package information about update : "
+ << m_name);
}
}
- _D("system app : %d", system_app);
- _D("update : %d", update);
+ LogDebug("system app : " << system_app);
+ LogDebug("update : " << update);
if (system_app && update) {
AddStep(&WrtInstaller::removeUpdateStep);
AddStep(&WrtInstaller::installStep);
break;
default:
- _D("Not available type");
+ LogDebug("Not available type");
break;
}
}
void WrtInstaller::OnReset(bundle* /*b*/)
{
- _D("OnReset");
+ LogDebug("OnReset");
}
void WrtInstaller::OnTerminate()
{
- _D("Wrt Shutdown now");
+ LogDebug("Wrt Shutdown now");
PluginUtils::unlockPluginInstallation(
m_installMode.installTime == InstallMode::InstallTime::PRELOAD);
if (m_initialized) {
fprintf(stderr,
"===========================================================\n");
// for dlog
- _D("===========================================================");
- _D("# wrt-installer #");
- _D("# argc %d", m_argc);
+ LogDebug("===========================================================");
+ LogDebug("# wrt-installer #");
+ LogDebug("# argc " << m_argc);
for (int i = 0; i < m_argc; i++) {
- _D("# argv[%d] = %s", i, m_argv[i]);
+ LogDebug("# argv[" << i << "] = " << m_argv[i]);
}
- _D("===========================================================");
+ LogDebug("===========================================================");
}
void WrtInstaller::OnEventReceived(const WRTInstallerNS::QuitEvent& /*event*/)
{
- _D("Quiting");
+ LogDebug("Quiting");
if (m_initialized) {
- _D("Wrt Shutdown now");
+ LogDebug("Wrt Shutdown now");
SwitchToStep(&WrtInstaller::shutdownStep);
DPL::Event::ControllerEventHandler<WRTInstallerNS::NextStepEvent>::
PostEvent(
WRTInstallerNS::NextStepEvent());
} else {
- _D("Quiting application");
+ LogDebug("Quiting application");
return Quit();
}
}
void WrtInstaller::OnEventReceived(
const WRTInstallerNS::NextStepEvent& /*event*/)
{
- _D("Executing next step");
+ LogDebug("Executing next step");
NextStep();
}
void WrtInstaller::installStep()
{
- _D("Installing widget ...");
+ LogDebug("Installing widget ...");
std::unique_ptr<char, free_deleter> packagePath(canonicalize_file_name(
m_packagePath.c_str()));
void WrtInstaller::installPluginsStep()
{
- _D("Installing plugins ...");
+ LogDebug("Installing plugins ...");
fprintf(stderr, "Installing plugins ...\n");
if (m_startupPluginInstallation) {
- _D("Plugin installation started because new plugin package found");
+ LogDebug("Plugin installation started because new plugin package found");
} else if (!PluginUtils::lockPluginInstallation(
m_installMode.installTime == InstallMode::InstallTime::PRELOAD))
{
- _E("Failed to open plugin installation lock file"
+ LogError("Failed to open plugin installation lock file"
" Plugins are currently installed by other process");
staticWrtPluginInstallationCallback(WRT_INSTALLER_ERROR_PLUGIN_INSTALLATION_FAILED,
this);
return;
}
- _D("Plugin DIRECTORY IS %s", PLUGIN_PATH.c_str());
+ LogDebug("Plugin DIRECTORY IS" << PLUGIN_PATH);
std::list<std::string> pluginsPaths;
struct dirent libdir;
struct stat tmp;
if (stat(path.c_str(), &tmp) == -1) {
- _E("Failed to open file %s", path.c_str());
+ LogError("Failed to open file" << path);
continue;
}
if (!S_ISDIR(tmp.st_mode)) {
- _E("Not a directory %s", path.c_str());
+ LogError("Not a directory" << path);
continue;
}
}
if (return_code != 0 || errno != 0) {
- _E("readdir_r() failed with %ls", DPL::GetErrnoString().c_str());
+ LogError("readdir_r() failed with " << DPL::GetErrnoString());
}
//set nb of plugins to install
//this value indicate how many callbacks are expected
m_numPluginsToInstall = pluginsPaths.size();
- _D("Plugins to install: %d", m_numPluginsToInstall);
+ LogDebug("Plugins to install: " << m_numPluginsToInstall);
m_pluginsPaths = pluginsPaths;
m_totalPlugins = m_numPluginsToInstall;
::PostEvent(WRTInstallerNS::InstallPluginEvent());
if (-1 == TEMP_FAILURE_RETRY(closedir(dir))) {
- _E("Failed to close dir: %s with error: %ls", PLUGIN_PATH.c_str(), DPL::GetErrnoString().c_str());
+ LogError("Failed to close dir: " << PLUGIN_PATH << " with error: "
+ << DPL::GetErrnoString());
}
}
void WrtInstaller::uninstallPkgNameStep()
{
- _D("Uninstalling widget ...");
- _D("Package name : %s", m_name.c_str());
+ LogDebug("Uninstalling widget ...");
+ LogDebug("Package name : " << m_name);
wrt_uninstall_widget(m_name.c_str(), this,
&staticWrtStatusCallback,
void WrtInstaller::removeUpdateStep()
{
- _D("This web app need to initialize preload app");
- _D("Package name : %s", m_name.c_str());
+ LogDebug("This web app need to initialize preload app");
+ LogDebug("Package name : " << m_name);
wrt_uninstall_widget(m_name.c_str(), this,
&staticWrtInitializeToPreloadCallback,
void WrtInstaller::unistallWgtFileStep()
{
- _D("Uninstalling widget ...");
+ LogDebug("Uninstalling widget ...");
Try {
// Parse config
DPL::OptionalString pkgId = configInfo.tizenPkgId;
if (!pkgId.IsNull()) {
- _D("Pkgid from packagePath : %ls", (*pkgId).c_str());
+ LogDebug("Pkgid from packagePath : " << pkgId);
wrt_uninstall_widget(
DPL::ToUTF8String(*pkgId).c_str(), this, &staticWrtStatusCallback,
!m_installByPkgmgr ? &staticWrtUninstallProgressCallback
: NULL,
pkgmgrSignalInterface);
} else {
- _E("Fail to uninstalling widget... ");
+ LogError("Fail to uninstalling widget... ");
m_returnStatus = -1;
DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::
PostEvent(
}
Catch(DPL::ZipInput::Exception::OpenFailed)
{
- _E("Failed to open widget package");
+ LogError("Failed to open widget package");
printf("failed: widget package does not exist\n");
m_returnStatus = -1;
DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::
Catch(DPL::ZipInput::Exception::OpenFileFailed)
{
printf("failed: widget config file does not exist\n");
- _E("Failed to open config.xml file");
+ LogError("Failed to open config.xml file");
m_returnStatus = -1;
DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::
PostEvent(
Catch(ElementParser::Exception::ParseError)
{
printf("failed: can not parse config file\n");
- _E("Failed to parse config.xml file");
+ LogError("Failed to parse config.xml file");
m_returnStatus = -1;
DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::
PostEvent(
void WrtInstaller::shutdownStep()
{
- _D("Closing Wrt connection ...");
+ LogDebug("Closing Wrt connection ...");
if (m_initialized) {
wrt_installer_shutdown();
m_initialized = false;
Assert(This);
if (status == WRT_SUCCESS) {
- _D("Init succesfull");
+ LogDebug("Init succesfull");
This->m_initialized = true;
This->m_returnStatus = 0;
This->DPL::Event::ControllerEventHandler<WRTInstallerNS::NextStepEvent>
::PostEvent(WRTInstallerNS::NextStepEvent());
} else {
- _E("Init unsuccesfull");
+ LogError("Init unsuccesfull");
This->m_returnStatus = -1;
This->DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>::
PostEvent(
if (WRT_SUCCESS != status) {
// Failure
- _E("Step failed");
+ LogError("Step failed");
This->m_returnStatus = 1;
This->showErrorMsg(status, tizenId, printMsg);
if (WRT_SUCCESS != status) {
// Failure
- _E("Step failed");
+ LogError("Step failed");
This->m_returnStatus = status;
This->showErrorMsg(status, tizenId, printMsg);
"## wrt-installer : %s %s was successful.\n",
tizenId.c_str(),
printMsg.c_str());
- _D("Status succesfull");
+ LogDebug("Status succesfull");
This->m_returnStatus = 0;
resultMsg += L" : " + DPL::FromUTF8String(PKGMGR_END_SUCCESS);
if (WRT_SUCCESS != status) {
// Failure
- _E("Step failed");
+ LogError("Step failed");
This->m_returnStatus = status;
This->DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>
"## wrt-installer : %s %s was successful.\n",
tizenId.c_str(),
printMsg.c_str());
- _D("Status succesfull");
+ LogDebug("Status succesfull");
This->m_returnStatus = 0;
resultMsg += L" : " + DPL::FromUTF8String(PKGMGR_END_SUCCESS);
if (This->m_installMode.installTime == InstallMode::InstallTime::PRELOAD &&
!This->m_packagePath.empty())
{
- _D("This widget is preloaded so it will be removed : %s", This->m_packagePath.c_str());
+ LogDebug("This widget is preloaded so it will be removed : "
+ << This->m_packagePath);
if (!WrtUtilRemove(This->m_packagePath)) {
- _E("Failed to remove %s", This->m_packagePath.c_str());
+ LogError("Failed to remove " << This->m_packagePath);
}
}
delete data;
This->m_numPluginsToInstall--;
- _D("Plugins to install: %d", This->m_numPluginsToInstall);
+ LogDebug("Plugins to install: " << This->m_numPluginsToInstall);
if (This->m_numPluginsToInstall < 1) {
- _D("All plugins installation completed");
+ LogDebug("All plugins installation completed");
fprintf(stderr, "All plugins installation completed.\n");
//remove installation request
if (!PluginUtils::removeInstallationRequiredFlag()) {
- _D("Failed to remove file initializing plugin installation");
+ LogDebug("Failed to remove file initializing plugin installation");
}
//remove lock file
if (!PluginUtils::unlockPluginInstallation(
This->m_installMode.installTime == InstallMode::InstallTime::PRELOAD))
{
- _D("Failed to remove installation lock");
+ LogDebug("Failed to remove installation lock");
}
This->DPL::Event::ControllerEventHandler<WRTInstallerNS::NextStepEvent>
fprintf(stderr,
"## wrt-installer : plugin installation successfull [%s]\n",
path.c_str());
- _D("One plugin Installation succesfull: %s", path.c_str());
+ LogDebug("One plugin Installation succesfull: " << path);
return;
}
// Failure
- _W("One of the plugins installation failed!: %s", path.c_str());
+ LogWarning("One of the plugins installation failed!: " << path);
switch (status) {
case WRT_INSTALLER_ERROR_PLUGIN_INSTALLATION_FAILED:
- _E("failed: plugin installation failed\n");
+ LogError("failed: plugin installation failed\n");
break;
case WRT_INSTALLER_ERROR_UNKNOWN:
- _E("failed: unknown error\n");
+ LogError("failed: unknown error\n");
break;
default:
std::string path = std::string(data->pluginPath);
- _D("Plugin Installation: %s progress: %2.0f description: %s", path.c_str(), percent, description);
+ LogDebug("Plugin Installation: " << path <<
+ " progress: " << percent <<
+ "description " << description);
}
void WrtInstaller::staticWrtInstallProgressCallback(float percent,
void* /*userdata*/)
{
//WrtInstaller *This = static_cast<WrtInstaller*>(userdata);
- _D(" progress: %2.0f description: %s", percent, description);
+ LogDebug(" progress: " << percent <<
+ " description: " << description);
}
void WrtInstaller::staticWrtUninstallProgressCallback(float percent,
const char* description,
void* /*userdata*/)
{
//WrtInstaller *This = static_cast<WrtInstaller*>(userdata);
- _D(" progress: %2.0f description: %s", percent, description);
+ LogDebug(" progress: " << percent <<
+ " description: " << description);
}
void WrtInstaller::showResultCallback(void *data, Evas_Object* /*obj*/,
void WrtInstaller::installNewPlugins()
{
- _D("Install new plugins");
+ LogDebug("Install new plugins");
if (!PluginUtils::lockPluginInstallation(
m_installMode.installTime == InstallMode::InstallTime::PRELOAD))
{
- _D("Lock NOT created");
+ LogDebug("Lock NOT created");
return;
}
if (!PluginUtils::checkPluginInstallationRequired()) {
- _D("Plugin installation not required");
+ LogDebug("Plugin installation not required");
PluginUtils::unlockPluginInstallation(
m_installMode.installTime == InstallMode::InstallTime::PRELOAD);
return;
{
// path=/opt/system/csc/Ozq2iEG15R-2.0.0-arm.wgt:op=install:removable=true
// parsing CSC configuration string
- _D("parseConfiguration");
+ LogDebug("parseConfiguration");
CSCConfiguration::dataMap result;
if (str.empty()) {
- _D("Input argument is empty");
+ LogDebug("Input argument is empty");
return result;
}
// Check and re-set the file open limitation
struct rlimit rlim;
if (getrlimit(RLIMIT_NOFILE, &rlim) != -1) {
- _D("RLIMIT_NOFILE sft(%d)", rlim.rlim_cur);
- _D("RLIMIT_NOFILE hrd(%d)", rlim.rlim_max);
+ LogDebug("RLIMIT_NOFILE sft(" << rlim.rlim_cur << ")");
+ LogDebug("RLIMIT_NOFILE hrd(" << rlim.rlim_max << ")");
if (rlim.rlim_cur < NOFILE_CNT_FOR_INSTALLER) {
rlim.rlim_cur = NOFILE_CNT_FOR_INSTALLER;
rlim.rlim_max = NOFILE_CNT_FOR_INSTALLER;
if (setrlimit(RLIMIT_NOFILE, &rlim) == -1) {
- _E("setrlimit is fail!!");
+ LogError("setrlimit is fail!!");
}
}
} else {
- _E("getrlimit is fail!!");
+ LogError("getrlimit is fail!!");
}
WrtInstaller app(argc, argv);
int ret = app.Exec();
- _D("App returned: %d", ret);
+ LogDebug("App returned: " << ret);
ret = app.getReturnStatus();
- _D("WrtInstaller returned: %d", ret);
+ LogDebug("WrtInstaller returned: " << ret);
return ret;
}
UNHANDLED_EXCEPTION_HANDLER_END
#include <sys/stat.h>
#include <unistd.h>
#include <dpl/exception.h>
+#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <dpl/semaphore.h>
#include <dpl/sstream.h>
#include <vcore/VCore.h>
#include <installer_main_thread.h>
#include <wrt_install_mode.h>
-#include <installer_log.h>
using namespace WrtDB;
if (0 == stat(path.c_str(), &st) && S_ISDIR(st.st_mode)) {
return true;
}
- _E("Cannot access directory [ %s ]", path.c_str());
+ LogError("Cannot access directory [ " << path << " ]");
return false;
}
WrtInstallerInitCallback callback)
{
try {
- _D("[WRT-API] INITIALIZING WRT INSTALLER...");
- _D("[WRT-API] BUILD: %s", __TIMESTAMP__);
+ LogDebug("[WRT-API] INITIALIZING WRT INSTALLER...");
+ LogDebug("[WRT-API] BUILD: " << __TIMESTAMP__);
// Touch InstallerController Singleton
InstallerMainThreadSingleton::Instance().TouchArchitecture();
InstallerMainThreadSingleton::Instance().AttachDatabases();
- _D("Prepare libxml2 to work in multithreaded program.");
+ LogDebug("Prepare libxml2 to work in multithreaded program.");
xmlInitParser();
// // Initialize Language Subtag registry
InitializeEvent());
if (callback) {
- _D("[WRT-API] WRT INSTALLER INITIALIZATION CALLBACK");
+ LogDebug("[WRT-API] WRT INSTALLER INITIALIZATION CALLBACK");
callback(WRT_SUCCESS, userdata);
}
} catch (const DPL::Exception& ex) {
- _E("Internal Error during Init:");
+ LogError("Internal Error during Init:");
DPL::Exception::DisplayKnownException(ex);
if (callback) {
callback(WRT_INSTALLER_ERROR_FATAL_ERROR, userdata);
void wrt_installer_shutdown()
{
try {
- _D("[WRT-API] DEINITIALIZING WRT INSTALLER...");
+ LogDebug("[WRT-API] DEINITIALIZING WRT INSTALLER...");
// Installer termination
CONTROLLER_POST_SYNC_EVENT(
ValidationCore::VCoreDeinit();
// Global deinit check
- _D("Cleanup libxml2 global values.");
+ LogDebug("Cleanup libxml2 global values.");
xmlCleanupParser();
} catch (const DPL::Exception& ex) {
- _E("Internal Error during Shutdown:");
+ LogError("Internal Error during Shutdown:");
DPL::Exception::DisplayKnownException(ex);
}
}
DPL::Log::LogSystemSingleton::Instance().AddProvider(oldStyleProvider);
}
- _D("[WRT-API] INSTALL WIDGET: %s", path);
+ LogDebug("[WRT-API] INSTALL WIDGET: " << path);
// Post installation event
CONTROLLER_POST_EVENT(
Logic::InstallerController,
UNHANDLED_EXCEPTION_HANDLER_BEGIN
{
std::string tizenAppid(tzAppid);
- _D("[WRT-API] UNINSTALL WIDGET: %s", tizenAppid.c_str());
+ LogDebug("[WRT-API] UNINSTALL WIDGET: " << tizenAppid);
// Post uninstallation event
CONTROLLER_POST_EVENT(
Logic::InstallerController,
{
UNHANDLED_EXCEPTION_HANDLER_BEGIN
{
- _D("[WRT-API] INSTALL PLUGIN: %s", pluginDir);
+ LogDebug("[WRT-API] INSTALL PLUGIN: " << pluginDir);
//Private data for status callback
//Resource is free in pluginInstallFinishedCallback
InstallerCallbacksTranslate::PluginStatusCallbackStruct*
#include "InstallerWrapper.h"
-#include <installer_log.h>
+#include <dpl/log/log.h>
#include <cstdio>
size_t startIndex = src.find(INSTALLER_MESSSGE_START);
if (startIndex == std::string::npos)
{
- _W("Installer message can not be found");
+ LogWarning("Installer message can not be found");
return std::string();
}
size_t newLineIndex = src.find("\n", startIndex);
{
msg += buffer;
}
- _D("%s", msg.c_str());
+ LogDebug(msg);
auto err = pclose(filehandle);
if (!WIFEXITED(err)) {
return OtherError;
int nr = sscanf(line.c_str(), INSTALLER_MESSAGE_ID_LINE_FAIL.c_str(), id);
if (1 != nr)
{
- _W("Can not read widget ID from message: %s", line.c_str());
+ LogWarning("Can not read widget ID from message: " << line);
delete[] id;
return OtherError;
}
if (1 != nr)
{
- _W("Can not read widget ID from message: %s", line.c_str());
+ LogWarning("Can not read widget ID from message: " << line);
delete[] id;
return OtherError;
}
bool uninstall(const std::string& tizenId)
{
std::string cmd = uninstallCmd + tizenId + " > /dev/null 2>/dev/null";
- _D("executing: %s", cmd.c_str());
+ LogDebug("executing: " << cmd);
return (system(cmd.c_str()) == EXIT_SUCCESS);
}
#include <libxml/parser.h>
#include <libxml/tree.h>
-#include <installer_log.h>
+#include <dpl/log/log.h>
//TODO: This file reads manifest file. This functionality is familiar with writing
// in wrt-installer but reading ws not necessary there.
#include <dpl/test/test_runner.h>
#include <InstallerWrapper.h>
#include <ManifestFile.h>
-#include <installer_log.h>
+#include <dpl/log/log.h>
using namespace InstallerWrapper;
Try
{
- _D("Package %s", mf.getValueByXpath("/p:manifest/@package").c_str());
+ LogDebug("Package " << mf.getValueByXpath("/p:manifest/@package"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@package")
== tizenId.substr(0,10));
- _D("type %s", mf.getValueByXpath("/p:manifest/@type").c_str());
+ LogDebug("type " << mf.getValueByXpath("/p:manifest/@type"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@type")
== "wgt");
- _D("version %s", mf.getValueByXpath("/p:manifest/@version").c_str());
+ LogDebug("version " << mf.getValueByXpath("/p:manifest/@version"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@version")
== "1.0");
- _D("label %s", mf.getValueByXpath("/p:manifest/p:label").c_str());
+ LogDebug("label " << mf.getValueByXpath("/p:manifest/p:label"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:label")
== "Manifest Example");
- _D("email %s", mf.getValueByXpath("/p:manifest/p:author/@email").c_str());
+ LogDebug("email " << mf.getValueByXpath("/p:manifest/p:author/@email"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@email")
== "manifest@misc.test.create.desktop.com");
- _D("href %s", mf.getValueByXpath("/p:manifest/p:author/@href").c_str());
+ LogDebug("href " << mf.getValueByXpath("/p:manifest/p:author/@href"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@href")
== "http://misc.test.create.desktop.com");
- _D("author %s", mf.getValueByXpath("/p:manifest/p:author").c_str());
+ LogDebug("author " << mf.getValueByXpath("/p:manifest/p:author"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author")
== "Manifest");
- _D("appid %s", mf.getValueByXpath("/p:manifest/p:ui-application/@appid").c_str());
+ LogDebug("appid " << mf.getValueByXpath("/p:manifest/p:ui-application/@appid"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@appid")
== tizenId);
- _D("nodisplay %s", mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay").c_str());
+ LogDebug("nodisplay " << mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay")
== "false");
- _D("type %s", mf.getValueByXpath("/p:manifest/p:ui-application/@type").c_str());
+ LogDebug("type " << mf.getValueByXpath("/p:manifest/p:ui-application/@type"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@type")
== "webapp");
- _D("extraid %s", mf.getValueByXpath("/p:manifest/p:ui-application/@extraid").c_str());
+ LogDebug("extraid " << mf.getValueByXpath("/p:manifest/p:ui-application/@extraid"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@extraid")
== "http://test.samsung.com/widget/manifestTest");
- _D("taskmanage %s", mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage").c_str());
+ LogDebug("taskmanage " << mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage")
== "true");
- _D("icon %s", mf.getValueByXpath("/p:manifest/p:ui-application/p:icon").c_str());
+ LogDebug("icon " << mf.getValueByXpath("/p:manifest/p:ui-application/p:icon"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:icon")
== (tizenId + ".png"));
#include <string>
#include <algorithm>
+#include <dpl/log/log.h>
#include <dpl/test/test_runner.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
#include <InstallerWrapper.h>
-#include <installer_log.h>
using namespace InstallerWrapper;
dao.getAppControlList(appcontrolList);
uninstall(tizenId);
- _D("Actual size %ls", appcontrolList.size().c_str());
+ LogDebug("Actual size" << appcontrolList.size());
RUNNER_ASSERT_MSG(appcontrolList.size() == 4, "Incorrect list size");
WrtDB::WidgetAppControl s;
s.src = DPL::FromUTF8String("edit1.html");
#include <string>
#include <dpl/test/test_runner.h>
+#include <dpl/log/log.h>
#include <dpl/wrt-dao-ro/plugin_dao_read_only.h>
#include <dpl/static_block.h>
-#include <installer_log.h>
////////////////////////////////////////////////////////////////////////////////
WrtDB::PluginDAOReadOnly pdao(#LIBNAME); \
RUNNER_ASSERT_MSG(pdao.getInstallationStatus() == WrtDB::PluginDAOReadOnly::INSTALLATION_COMPLETED, "Plugin is not installed correctly"); \
} Catch(DPL::Exception) { \
- _E("%s", _rethrown_exception.DumpToString().c_str()); \
+ LogError(_rethrown_exception.DumpToString()); \
RUNNER_ASSERT_MSG(false, "DPL::Exception"); \
} \
} \
*/
#include <dpl/test/test_runner.h>
-#include <installer_log.h>
+#include <dpl/log/log.h>
#include <dpl/wrt-dao-ro/WrtDatabase.h>
int main (int argc, char *argv[])
{
- _D("Starting tests");
+ LogDebug("Starting tests");
WrtDB::WrtDatabase::attachToThreadRW();
int status =