From ba94bc340b6bac5dfb8108abc002031fe4558ba3 Mon Sep 17 00:00:00 2001 From: Piotr Kosko Date: Wed, 27 May 2015 14:11:48 +0200 Subject: [PATCH] [Systemsetting] Added logs in methods onEntered and onReturn Change-Id: I08736a1ad30e2363998c01cd01725a6bce416b54 Signed-off-by: Piotr Kosko --- src/systemsetting/systemsetting_instance.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/systemsetting/systemsetting_instance.cc b/src/systemsetting/systemsetting_instance.cc index d6be5f4d..f6f35950 100644 --- a/src/systemsetting/systemsetting_instance.cc +++ b/src/systemsetting/systemsetting_instance.cc @@ -40,6 +40,7 @@ using namespace extension::systemsetting; SystemSettingInstance::SystemSettingInstance() { + LoggerD("Enter"); using std::placeholders::_1; using std::placeholders::_2; @@ -54,11 +55,12 @@ SystemSettingInstance::SystemSettingInstance() SystemSettingInstance::~SystemSettingInstance() { + LoggerD("Enter"); } void SystemSettingInstance::getProperty(const picojson::value& args, picojson::object& out) { - LoggerD(""); + LoggerD("Enter"); const double callback_id = args.get("callbackId").get(); const std::string& type = args.get("type").get(); @@ -68,10 +70,12 @@ void SystemSettingInstance::getProperty(const picojson::value& args, picojson::o LoggerD("Getting platform value"); picojson::value result = picojson::value(picojson::object()); PlatformResult status = getPlatformPropertyValue(type, &result); - if(status.IsSuccess()) + if(status.IsSuccess()) { ReportSuccess(result, response->get()); - else + } else { + LoggerE("Failed: getPlatformPropertyValue()"); ReportError(status, &response->get()); + } }; auto get_response = [this, callback_id](const std::shared_ptr& response) -> void { @@ -88,6 +92,7 @@ void SystemSettingInstance::getProperty(const picojson::value& args, picojson::o PlatformResult SystemSettingInstance::getPlatformPropertyValue( const std::string& settingType, picojson::value* out) { + LoggerD("Enter"); picojson::object& result_obj = out->get(); int ret; @@ -129,7 +134,7 @@ PlatformResult SystemSettingInstance::getPlatformPropertyValue( void SystemSettingInstance::setProperty(const picojson::value& args, picojson::object& out) { - LoggerD(""); + LoggerD("Enter"); const double callback_id = args.get("callbackId").get(); @@ -142,10 +147,12 @@ void SystemSettingInstance::setProperty(const picojson::value& args, picojson::o auto get = [this, type, value](const std::shared_ptr& response) -> void { LoggerD("Setting platform value"); PlatformResult status = setPlatformPropertyValue(type, value); - if (status.IsSuccess()) + if (status.IsSuccess()) { ReportSuccess(response->get()); - else + } else { + LoggerE("Failed: setPlatformPropertyValue()"); ReportError(status, &response->get()); + } }; auto get_response = [this, callback_id](const std::shared_ptr& response) -> void { @@ -162,6 +169,7 @@ void SystemSettingInstance::setProperty(const picojson::value& args, picojson::o PlatformResult SystemSettingInstance::setPlatformPropertyValue( const std::string& settingType, const std::string& settingValue) { + LoggerD("Enter"); int ret; if (settingType == SETTING_HOME_SCREEN) { ret = system_settings_set_value_string( -- 2.34.1