From 1b1a2b8074fdc48e3b62372340e9a955b6205dbd Mon Sep 17 00:00:00 2001 From: Szymon Jastrzebski Date: Mon, 6 Nov 2017 14:02:09 +0100 Subject: [PATCH] [PROJECT] Refactoring entering logs into ScopeLogger [Verification] Code compiles Change-Id: I2733b7a7bcafa50f5a6a87195ec9efbcec97c574 Signed-off-by: Szymon Jastrzebski --- src/alarm/alarm_manager.cc | 4 +- src/alarm/alarm_utils.cc | 2 +- src/application/application_instance.cc | 8 +- src/application/application_manager.cc | 28 +++--- src/datacontrol/datacontrol_instance.cc | 16 +-- .../humanactivitymonitor_instance.cc | 6 +- src/nfc/nfc_adapter.cc | 4 +- src/nfc/nfc_instance.cc | 4 +- src/notification/common_notification.cc | 110 ++++++++++----------- src/notification/notification_instance.cc | 4 +- src/notification/notification_manager.cc | 8 +- src/notification/status_notification.cc | 2 +- src/notification/user_notification.cc | 30 +++--- 13 files changed, 113 insertions(+), 113 deletions(-) diff --git a/src/alarm/alarm_manager.cc b/src/alarm/alarm_manager.cc index 09a5b2a..8ca564b 100644 --- a/src/alarm/alarm_manager.cc +++ b/src/alarm/alarm_manager.cc @@ -247,7 +247,7 @@ void AlarmManager::Add(const picojson::value& args, picojson::object& out) { void AlarmManager::AddAlarmNotification(const picojson::value& args, picojson::object& out) { using namespace extension::notification; - LoggerD("Entered"); + ScopeLogger(); CHECK_PRIVILEGE_ACCESS(kPrivilegeAlarm, &out); CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out); @@ -666,7 +666,7 @@ void AlarmManager::Get(const picojson::value& args, picojson::object& out) { void AlarmManager::GetAlarmNotification(const picojson::value& args, picojson::object& out) { using namespace extension::notification; - LoggerD("Entered"); + ScopeLogger(); int alarm_id = 0; int ret = ALARM_ERROR_NONE; diff --git a/src/alarm/alarm_utils.cc b/src/alarm/alarm_utils.cc index b51fa63..31e1862 100644 --- a/src/alarm/alarm_utils.cc +++ b/src/alarm/alarm_utils.cc @@ -153,7 +153,7 @@ PlatformResult AppControlToServiceExtraData(const picojson::object& app_obj, } PlatformResult ArrayDaysToMask(const picojson::array& days_of_the_week, int* repeat_value) { - LoggerD("Entered"); + ScopeLogger(); for (auto iter = days_of_the_week.begin(); iter != days_of_the_week.end(); ++iter) { auto day = (*iter).get(); if (kSundayShort == day) { diff --git a/src/application/application_instance.cc b/src/application/application_instance.cc index ec77dc8..00d98d6 100644 --- a/src/application/application_instance.cc +++ b/src/application/application_instance.cc @@ -164,14 +164,14 @@ void ApplicationInstance::GetAppMetaData(const picojson::value& args, picojson:: } void ApplicationInstance::GetBatteryUsageInfo(const picojson::value& args, picojson::object& out) { - LoggerD("Entered"); + ScopeLogger(); CHECK_PRIVILEGE_ACCESS(kPrivilegeAppHistoryRead, &out); manager_.GetBatteryUsageInfo(args, &out); } void ApplicationInstance::GetAppsUsageInfo(const picojson::value& args, picojson::object& out) { - LoggerD("Entered"); + ScopeLogger(); CHECK_PRIVILEGE_ACCESS(kPrivilegeAppHistoryRead, &out); manager_.GetAppsUsageInfo(args, &out); @@ -316,7 +316,7 @@ void ApplicationInstance::RemoveEventListener(const picojson::value& args, picoj } void ApplicationInstance::AddStatusListener(const picojson::value& args, picojson::object& out) { - LoggerD("Entered"); + ScopeLogger(); JsonCallback cb = [this](picojson::value* event) -> void { Instance::PostMessage(this, event->serialize().c_str()); @@ -331,7 +331,7 @@ void ApplicationInstance::AddStatusListener(const picojson::value& args, picojso } void ApplicationInstance::RemoveStatusListener(const picojson::value& args, picojson::object& out) { - LoggerD("Entered"); + ScopeLogger(); PlatformResult result = manager_.StopStatusChangeListener(); if (result) { diff --git a/src/application/application_manager.cc b/src/application/application_manager.cc index df798f1..9d67ef7 100644 --- a/src/application/application_manager.cc +++ b/src/application/application_manager.cc @@ -1190,7 +1190,7 @@ void ApplicationManager::GetAppSharedUri(const std::string& app_id, picojson::ob PlatformResult ApplicationManager::BatteryUsageFilter(const picojson::value& args, const context_history_filter_h filter, context_history_data_e* data_type_out) { - LoggerD("Entered"); + ScopeLogger(); int ret = CONTEXT_HISTORY_ERROR_NONE; int limit = kMaximumBatteryRetrievedObjects; if (args.contains("limit")) { @@ -1226,7 +1226,7 @@ PlatformResult ApplicationManager::BatteryUsageFilter(const picojson::value& arg PlatformResult ApplicationManager::BatteryUsageAttributes(const context_history_record_h record, picojson::object* object) { - LoggerD("Entered"); + ScopeLogger(); int ret = CONTEXT_HISTORY_ERROR_NONE; double amount = 0.0; @@ -1256,7 +1256,7 @@ PlatformResult ApplicationManager::BatteryUsageAttributes(const context_history_ PlatformResult ApplicationManager::AppsUsageFilter(const picojson::value& args, const context_history_filter_h filter, context_history_data_e* data_type_out) { - LoggerD("Entered"); + ScopeLogger(); int ret = CONTEXT_HISTORY_ERROR_NONE; int limit = kMaximumAppsRetrievedObjects; if (args.contains("limit")) { @@ -1325,7 +1325,7 @@ PlatformResult ApplicationManager::AppsUsageFilter(const picojson::value& args, PlatformResult ApplicationManager::AppsUsageAttributes(const context_history_record_h record, picojson::object* object) { - LoggerD("Entered"); + ScopeLogger(); int ret = CONTEXT_HISTORY_ERROR_NONE; int total_count = 0; @@ -1372,7 +1372,7 @@ PlatformResult ApplicationManager::AppsUsageAttributes(const context_history_rec #endif void ApplicationManager::GetBatteryUsageInfo(const picojson::value& args, picojson::object* out) { - LoggerD("Entered"); + ScopeLogger(); #if defined(TIZEN_MOBILE) || defined(TIZEN_WEARABLE) int callback_id = -1; @@ -1382,7 +1382,7 @@ void ApplicationManager::GetBatteryUsageInfo(const picojson::value& args, picojs } auto get_battery_usage = [args](const std::shared_ptr& response) -> void { - LoggerD("Entered"); + ScopeLogger(); PlatformResult result = ApplicationManager::GetContextHistory( args, &response.get()->get(), &ApplicationManager::BatteryUsageFilter, &ApplicationManager::BatteryUsageAttributes); @@ -1393,7 +1393,7 @@ void ApplicationManager::GetBatteryUsageInfo(const picojson::value& args, picojs auto get_battery_usage_response = [this, callback_id](const std::shared_ptr& response) -> void { - LoggerD("Entered"); + ScopeLogger(); picojson::object& obj = response->get(); obj.insert(std::make_pair(kCallbackId, picojson::value(static_cast(callback_id)))); Instance::PostMessage(&this->instance_, response->serialize().c_str()); @@ -1413,13 +1413,13 @@ void ApplicationManager::GetBatteryUsageInfo(const picojson::value& args, picojs } void ApplicationManager::GetAppsUsageInfo(const picojson::value& args, picojson::object* out) { - LoggerD("Entered"); + ScopeLogger(); #if defined(TIZEN_MOBILE) || defined(TIZEN_WEARABLE) int callback_id = static_cast(args.get(kCallbackId).get()); auto get_apps_usage = [args](const std::shared_ptr& response) -> void { - LoggerD("Entered"); + ScopeLogger(); PlatformResult result = ApplicationManager::GetContextHistory( args, &response.get()->get(), &ApplicationManager::AppsUsageFilter, &ApplicationManager::AppsUsageAttributes); @@ -1430,7 +1430,7 @@ void ApplicationManager::GetAppsUsageInfo(const picojson::value& args, picojson: auto get_apps_usage_response = [this, callback_id](const std::shared_ptr& response) -> void { - LoggerD("Entered"); + ScopeLogger(); picojson::object& obj = response->get(); obj.insert(std::make_pair(kCallbackId, picojson::value(static_cast(callback_id)))); Instance::PostMessage(&this->instance_, response->serialize().c_str()); @@ -1929,7 +1929,7 @@ void ApplicationManager::OnStatusEvent(const char* type, const char* app_id, app_manager_event_type_e event_type, app_manager_event_state_e event_state, app_manager_event_h handle, void* user_data) { - LoggerD("Entered"); + ScopeLogger(); if (APP_MANAGER_EVENT_STATE_COMPLETED != event_state) { LoggerD("State different from completed"); @@ -1974,7 +1974,7 @@ PlatformResult ApplicationManager::GetContextHistory( context_history_data_e* data_type), common::PlatformResult (*add_attributes_to_object)(const context_history_record_h, picojson::object*)) { - LoggerD("Entered"); + ScopeLogger(); context_history_list_h list = nullptr; context_history_h handle = nullptr; context_history_filter_h filter = nullptr; @@ -2058,7 +2058,7 @@ PlatformResult ApplicationManager::GetContextHistory( #endif PlatformResult ApplicationManager::StartStatusListener(const JsonCallback& callback) { - LoggerD("Entered"); + ScopeLogger(); int ret = APP_MANAGER_ERROR_NONE; @@ -2087,7 +2087,7 @@ PlatformResult ApplicationManager::StartStatusListener(const JsonCallback& callb } PlatformResult ApplicationManager::StopStatusChangeListener() { - LoggerD("Entered"); + ScopeLogger(); if (app_status_handle_) { int ret = app_manager_unset_event_cb(app_status_handle_); diff --git a/src/datacontrol/datacontrol_instance.cc b/src/datacontrol/datacontrol_instance.cc index c0cd6a8..0c6ff0a 100644 --- a/src/datacontrol/datacontrol_instance.cc +++ b/src/datacontrol/datacontrol_instance.cc @@ -900,7 +900,7 @@ void DatacontrolInstance::MappedDataControlConsumerUpdatevalue(const picojson::v int DatacontrolInstance::CreateMAPHandle(const std::string& providerId, const std::string& dataId, data_control_h* handle) { - LoggerD("Enter"); + ScopeLogger(); int result = DATA_CONTROL_ERROR_NONE; result = ::data_control_map_create(handle); @@ -917,7 +917,7 @@ int DatacontrolInstance::CreateMAPHandle(const std::string& providerId, const st int DatacontrolInstance::CreateSQLHandle(const std::string& providerId, const std::string& dataId, data_control_h* handle) { - LoggerD("Enter"); + ScopeLogger(); int result = DATA_CONTROL_ERROR_NONE; result = ::data_control_sql_create(handle); @@ -934,7 +934,7 @@ int DatacontrolInstance::CreateSQLHandle(const std::string& providerId, const st PlatformResult DatacontrolInstance::ChangeTypeToString(data_control_data_change_type_e type_e, std::string* type) { - LoggerD("Enter"); + ScopeLogger(); switch (type_e) { case DATA_CONTROL_DATA_CHANGE_SQL_UPDATE: @@ -964,7 +964,7 @@ PlatformResult DatacontrolInstance::ChangeTypeToString(data_control_data_change_ void DatacontrolInstance::callback(data_control_h provider, data_control_data_change_type_e type, bundle* bundle_data, void* user_data) { - LoggerD("Enter"); + ScopeLogger(); auto data = static_cast(user_data); @@ -1030,7 +1030,7 @@ void DatacontrolInstance::callback(data_control_h provider, data_control_data_ch bundle_foreach( bundle_data, [](const char* key, const int type, const bundle_keyval_t* kv, void* user_data) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& row_data = *(static_cast(user_data)); @@ -1055,7 +1055,7 @@ void DatacontrolInstance::callback(data_control_h provider, data_control_data_ch // occur while adding listener void DatacontrolInstance::result_callback(data_control_h provider, data_control_error_e result, int callback_id, void* user_data) { - LoggerD("Enter"); + ScopeLogger(); if (DATA_CONTROL_ERROR_NONE != result) { auto data = static_cast(user_data); picojson::value event = picojson::value(picojson::object()); @@ -1072,7 +1072,7 @@ void DatacontrolInstance::result_callback(data_control_h provider, data_control_ } void DatacontrolInstance::AddChangeListener(const picojson::value& args, picojson::object& out) { - LoggerD("Enter"); + ScopeLogger(); CHECK_PRIVILEGE_ACCESS(kPrivilegeDatasharing, &out); CHECK_PRIVILEGE_ACCESS(kPrivilegeAppmanagerLaunch, &out); @@ -1138,7 +1138,7 @@ void DatacontrolInstance::AddChangeListener(const picojson::value& args, picojso } void DatacontrolInstance::RemoveChangeListener(const picojson::value& args, picojson::object& out) { - LoggerD("Enter"); + ScopeLogger(); CHECK_PRIVILEGE_ACCESS(kPrivilegeDatasharing, &out); CHECK_PRIVILEGE_ACCESS(kPrivilegeAppmanagerLaunch, &out); diff --git a/src/humanactivitymonitor/humanactivitymonitor_instance.cc b/src/humanactivitymonitor/humanactivitymonitor_instance.cc index 3799126..50d6ba8 100644 --- a/src/humanactivitymonitor/humanactivitymonitor_instance.cc +++ b/src/humanactivitymonitor/humanactivitymonitor_instance.cc @@ -388,7 +388,7 @@ void HumanActivityMonitorInstance::HumanActivityMonitorManagerReadRecorderData( void HumanActivityMonitorInstance::GestureManagerIsGestureSupported(const picojson::value& args, picojson::object& out) { - LoggerD("Enter"); + ScopeLogger(); CHECK_EXIST(args, "type", out) const auto& type = args.get("type").get(); @@ -404,7 +404,7 @@ void HumanActivityMonitorInstance::GestureManagerIsGestureSupported(const picojs void HumanActivityMonitorInstance::GestureManagerAddGestureRecognitionListener( const picojson::value& args, picojson::object& out) { - LoggerD("Enter"); + ScopeLogger(); CHECK_EXIST(args, "type", out) CHECK_EXIST(args, "alwaysOn", out) @@ -430,7 +430,7 @@ void HumanActivityMonitorInstance::GestureManagerAddGestureRecognitionListener( void HumanActivityMonitorInstance::GestureManagerRemoveGestureRecognitionListener( const picojson::value& args, picojson::object& out) { - LoggerD("Enter"); + ScopeLogger(); CHECK_EXIST(args, "type", out) CHECK_EXIST(args, "alwaysOn", out) diff --git a/src/nfc/nfc_adapter.cc b/src/nfc/nfc_adapter.cc index 58b3f46..66ecbb4 100644 --- a/src/nfc/nfc_adapter.cc +++ b/src/nfc/nfc_adapter.cc @@ -1494,7 +1494,7 @@ void NFCAdapter::GetAIDsForCategory(const std::string& type, } PlatformResult NFCAdapter::SetPreferredApp() { - LoggerD("Entered"); + ScopeLogger(); if (m_is_preferred_app_set) { return PlatformResult(ErrorCode::NO_ERROR); @@ -1511,7 +1511,7 @@ PlatformResult NFCAdapter::SetPreferredApp() { } PlatformResult NFCAdapter::UnsetPreferredApp() { - LoggerD("Entered"); + ScopeLogger(); if (!m_is_preferred_app_set) { return PlatformResult(ErrorCode::NO_ERROR); diff --git a/src/nfc/nfc_instance.cc b/src/nfc/nfc_instance.cc index 3727407..a64c42d 100644 --- a/src/nfc/nfc_instance.cc +++ b/src/nfc/nfc_instance.cc @@ -994,7 +994,7 @@ void NFCInstance::GetAIDsForCategory(const picojson::value& args, picojson::obje } void NFCInstance::SetPreferredApp(const picojson::value& args, picojson::object& out) { - LoggerD("Entered"); + ScopeLogger(); CHECK_PRIVILEGE_ACCESS(kPrivilegeNfcCardEmulation, &out); PlatformResult result = NFCAdapter::GetInstance()->SetPreferredApp(); @@ -1006,7 +1006,7 @@ void NFCInstance::SetPreferredApp(const picojson::value& args, picojson::object& } void NFCInstance::UnsetPreferredApp(const picojson::value& args, picojson::object& out) { - LoggerD("Entered"); + ScopeLogger(); CHECK_PRIVILEGE_ACCESS(kPrivilegeNfcCardEmulation, &out); PlatformResult result = NFCAdapter::GetInstance()->UnsetPreferredApp(); diff --git a/src/notification/common_notification.cc b/src/notification/common_notification.cc index eafe781..52cc10b 100644 --- a/src/notification/common_notification.cc +++ b/src/notification/common_notification.cc @@ -60,7 +60,7 @@ CommonNotification::~CommonNotification() { } bool CommonNotification::IsColorFormatNumeric(const std::string& color) { - LoggerD("Enter"); + ScopeLogger(); std::string hexCode = "0123456789abcdef"; if (7 != color.length() || '#' != color[0]) { return false; @@ -77,7 +77,7 @@ bool CommonNotification::IsColorFormatNumeric(const std::string& color) { PlatformResult CommonNotification::SetLayout(notification_h noti_handle, const std::string& noti_type) { - LoggerD("Enter"); + ScopeLogger(); notification_ly_type_e noti_layout = NOTIFICATION_LY_NONE; if ("SIMPLE" == noti_type) { @@ -109,7 +109,7 @@ PlatformResult CommonNotification::SetLayout(notification_h noti_handle, } static bool ServiceExtraDataCb(app_control_h service, const char* key, void* user_data) { - LoggerD("Enter"); + ScopeLogger(); if (nullptr == user_data || nullptr == key) { LoggerE("User data or key not exist"); return true; @@ -150,7 +150,7 @@ static bool ServiceExtraDataCb(app_control_h service, const char* key, void* use PlatformResult CommonNotification::Create(notification_type_e noti_type, notification_h* noti_handle) { - LoggerD("Enter"); + ScopeLogger(); *noti_handle = notification_create(noti_type); if (!*noti_handle) { return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Cannot make new notification object"); @@ -172,7 +172,7 @@ PlatformResult CommonNotification::Create(notification_type_e noti_type, PlatformResult CommonNotification::StatusTypeFromPlatform(notification_type_e noti_type, notification_ly_type_e noti_layout, std::string* type) { - LoggerD("Enter"); + ScopeLogger(); if (NOTIFICATION_TYPE_NOTI == noti_type) { if (NOTIFICATION_LY_NOTI_EVENT_SINGLE == noti_layout || NOTIFICATION_LY_NOTI_EVENT_MULTIPLE == noti_layout) { @@ -195,7 +195,7 @@ PlatformResult CommonNotification::StatusTypeFromPlatform(notification_type_e no PlatformResult CommonNotification::StatusTypeToPlatform(const std::string& type, notification_type_e* noti_type) { - LoggerD("Enter"); + ScopeLogger(); if ("SIMPLE" == type || "THUMBNAIL" == type) { *noti_type = NOTIFICATION_TYPE_NOTI; } else if ("ONGOING" == type || "PROGRESS" == type) { @@ -211,7 +211,7 @@ PlatformResult CommonNotification::StatusTypeToPlatform(const std::string& type, PlatformResult CommonNotification::GetImage(notification_h noti_handle, notification_image_type_e image_type, std::string* image_path) { - LoggerD("Enter"); + ScopeLogger(); char* path = nullptr; *image_path = ""; @@ -230,7 +230,7 @@ PlatformResult CommonNotification::GetImage(notification_h noti_handle, PlatformResult CommonNotification::SetImage(notification_h noti_handle, notification_image_type_e image_type, const std::string& image_path) { - LoggerD("Enter"); + ScopeLogger(); int ret = notification_set_image(noti_handle, image_type, image_path.c_str()); if (NOTIFICATION_ERROR_NONE != ret) { return LogAndCreateResult( @@ -244,7 +244,7 @@ PlatformResult CommonNotification::SetImage(notification_h noti_handle, PlatformResult CommonNotification::GetText(notification_h noti_handle, notification_text_type_e text_type, std::string* noti_text) { - LoggerD("Enter"); + ScopeLogger(); char* text = nullptr; *noti_text = ""; @@ -262,7 +262,7 @@ PlatformResult CommonNotification::GetText(notification_h noti_handle, PlatformResult CommonNotification::SetText(notification_h noti_handle, notification_text_type_e text_type, const std::string& noti_text) { - LoggerD("Enter"); + ScopeLogger(); int ret = notification_set_text(noti_handle, text_type, noti_text.c_str(), nullptr, NOTIFICATION_VARIABLE_TYPE_NONE); if (NOTIFICATION_ERROR_NONE != ret) { @@ -276,7 +276,7 @@ PlatformResult CommonNotification::SetText(notification_h noti_handle, PlatformResult CommonNotification::GetNumber(notification_h noti_handle, notification_text_type_e text_type, long* number) { - LoggerD("Enter"); + ScopeLogger(); std::string text; PlatformResult status = GetText(noti_handle, text_type, &text); CHECK_ERROR(status); @@ -290,7 +290,7 @@ PlatformResult CommonNotification::GetNumber(notification_h noti_handle, } PlatformResult CommonNotification::GetLedColor(notification_h noti_handle, std::string* led_color) { - LoggerD("Enter"); + ScopeLogger(); unsigned int color = 0; notification_led_op_e type = NOTIFICATION_LED_OP_ON; @@ -322,7 +322,7 @@ PlatformResult CommonNotification::GetLedColor(notification_h noti_handle, std:: PlatformResult CommonNotification::GetLedPeriod(notification_h noti_handle, unsigned long* on_period, unsigned long* off_period) { - LoggerD("Enter"); + ScopeLogger(); int on_time = 0; int off_time = 0; @@ -339,7 +339,7 @@ PlatformResult CommonNotification::GetLedPeriod(notification_h noti_handle, PlatformResult CommonNotification::GetSoundPath(notification_h noti_handle, std::string* sound_path) { - LoggerD("Enter"); + ScopeLogger(); *sound_path = ""; const char* path = nullptr; @@ -362,7 +362,7 @@ PlatformResult CommonNotification::GetSoundPath(notification_h noti_handle, PlatformResult CommonNotification::SetSoundPath(notification_h noti_handle, const std::string& sound_path) { - LoggerD("Enter"); + ScopeLogger(); int ret = notification_set_sound(noti_handle, NOTIFICATION_SOUND_TYPE_USER_DATA, sound_path.c_str()); if (NOTIFICATION_ERROR_NONE != ret) { @@ -376,7 +376,7 @@ PlatformResult CommonNotification::SetSoundPath(notification_h noti_handle, } PlatformResult CommonNotification::GetVibration(notification_h noti_handle, bool* vibration) { - LoggerD("Enter"); + ScopeLogger(); notification_vibration_type_e vib_type = NOTIFICATION_VIBRATION_TYPE_NONE; if (NOTIFICATION_ERROR_NONE != notification_get_vibration(noti_handle, &vib_type, nullptr)) { @@ -395,7 +395,7 @@ PlatformResult CommonNotification::GetVibration(notification_h noti_handle, bool PlatformResult CommonNotification::GetApplicationControl(app_control_h app_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; char* operation = nullptr; @@ -455,7 +455,7 @@ PlatformResult CommonNotification::GetApplicationControl(app_control_h app_handl PlatformResult CommonNotification::SetApplicationControl(app_control_h app_handle, const picojson::object& app_ctrl) { - LoggerD("Enter"); + ScopeLogger(); picojson::value val(app_ctrl); const std::string& operation = FromJson(app_ctrl, "operation"); @@ -529,7 +529,7 @@ PlatformResult CommonNotification::SetApplicationControl(app_control_h app_handl } PlatformResult CommonNotification::GetApplicationId(app_control_h app_handle, std::string* app_id) { - LoggerD("Enter"); + ScopeLogger(); char* app_id_str = nullptr; SCOPE_EXIT { free(app_id_str); @@ -552,7 +552,7 @@ PlatformResult CommonNotification::GetApplicationId(app_control_h app_handle, st PlatformResult CommonNotification::SetApplicationId(app_control_h app_handle, const std::string& app_id) { - LoggerD("Enter"); + ScopeLogger(); int ret = app_control_set_app_id(app_handle, app_id.c_str()); if (APP_CONTROL_ERROR_NONE != ret) { return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Set applicaiton ID error", @@ -567,7 +567,7 @@ PlatformResult CommonNotification::SetApplicationId(app_control_h app_handle, PlatformResult CommonNotification::GetProgressValue(notification_h noti_handle, const std::string& progress_type, double* progress_value) { - LoggerD("Enter"); + ScopeLogger(); double tmp_progress_value = 0.0; if (kProgressTypeByte == progress_type) { @@ -594,7 +594,7 @@ PlatformResult CommonNotification::GetProgressValue(notification_h noti_handle, PlatformResult CommonNotification::SetProgressValue(notification_h noti_handle, const std::string& progress_type, double progress_value, bool is_update) { - LoggerD("Enter"); + ScopeLogger(); int ret; if (kProgressTypeByte == progress_type) { @@ -624,7 +624,7 @@ PlatformResult CommonNotification::SetProgressValue(notification_h noti_handle, } PlatformResult CommonNotification::GetPostedTime(notification_h noti_handle, time_t* posted_time) { - LoggerD("Enter"); + ScopeLogger(); *posted_time = 0; if (NOTIFICATION_ERROR_NONE != notification_get_insert_time(noti_handle, posted_time)) { @@ -635,7 +635,7 @@ PlatformResult CommonNotification::GetPostedTime(notification_h noti_handle, tim } PlatformResult CommonNotification::GetNotiHandle(int id, notification_h* noti_handle) { - LoggerD("Enter"); + ScopeLogger(); *noti_handle = notification_load(nullptr, id); if (nullptr == *noti_handle) { return LogAndCreateResult(ErrorCode::NOT_FOUND_ERR, "Not found or removed notification id"); @@ -646,7 +646,7 @@ PlatformResult CommonNotification::GetNotiHandle(int id, notification_h* noti_ha PlatformResult CommonNotification::GetAppControl(notification_h noti_handle, app_control_h* app_control) { - LoggerD("Enter"); + ScopeLogger(); int ret = notification_get_launch_option(noti_handle, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, static_cast(app_control)); if (NOTIFICATION_ERROR_NONE != ret) { @@ -658,7 +658,7 @@ PlatformResult CommonNotification::GetAppControl(notification_h noti_handle, } PlatformResult CommonNotification::CreateAppControl(app_control_h* app_control) { - LoggerD("Enter"); + ScopeLogger(); int ret = app_control_create(app_control); if (APP_CONTROL_ERROR_NONE != ret) { return LogAndCreateResult(ErrorCode::INVALID_VALUES_ERR, "Application create error", @@ -670,7 +670,7 @@ PlatformResult CommonNotification::CreateAppControl(app_control_h* app_control) PlatformResult CommonNotification::SetAppControl(notification_h noti_handle, app_control_h app_control) { - LoggerD("Enter"); + ScopeLogger(); int ret = notification_set_launch_option(noti_handle, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, static_cast(app_control)); if (APP_CONTROL_ERROR_NONE != ret) { @@ -698,7 +698,7 @@ PlatformResult CommonNotification::UpdateNotificationAfterPost(notification_h no PlatformResult CommonNotification::PostNotification(const picojson::object& args, bool is_update, picojson::object* out_ptr, GetHandleFromJsonFun getHandle) { - LoggerD("Enter"); + ScopeLogger(); notification_h noti_handle = nullptr; int ret = NOTIFICATION_ERROR_NONE; int id = NOTIFICATION_PRIV_ID_NONE; @@ -734,7 +734,7 @@ PlatformResult CommonNotification::PostNotification(const picojson::object& args PlatformResult CommonNotification::AddCommonMembersToJson(int id, notification_h noti_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; out["id"] = picojson::value(std::to_string(id)); @@ -762,7 +762,7 @@ PlatformResult CommonNotification::AddCommonMembersToJson(int id, notification_h PlatformResult CommonNotification::AddTypeToJson(notification_h noti_handle, const std::string& key, picojson::object* out_ptr, std::string* noti_type_str) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; // Notification type notification_type_e noti_type = NOTIFICATION_TYPE_NONE; @@ -789,7 +789,7 @@ PlatformResult CommonNotification::AddTypeToJson(notification_h noti_handle, con PlatformResult CommonNotification::AddProgressTypeAndValueToJson(notification_h noti_handle, const std::string& noti_type_str, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; std::string progress_type; @@ -816,7 +816,7 @@ PlatformResult CommonNotification::AddProgressTypeAndValueToJson(notification_h PlatformResult CommonNotification::AddEventsNumberToJson(notification_h noti_handle, const std::string& key, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; long number = 0; @@ -830,7 +830,7 @@ PlatformResult CommonNotification::AddEventsNumberToJson(notification_h noti_han PlatformResult CommonNotification::AddDetailInfosToJson(notification_h noti_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; picojson::value result_json = picojson::value(picojson::array()); @@ -895,7 +895,7 @@ PlatformResult CommonNotification::AddTextToJson(notification_h noti_handle, PlatformResult CommonNotification::AddLedOnOffPeriodToJson(notification_h noti_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; unsigned long on_period = 0; @@ -911,7 +911,7 @@ PlatformResult CommonNotification::AddLedOnOffPeriodToJson(notification_h noti_h PlatformResult CommonNotification::AddPathsArrayToJson(notification_h noti_handle, ImageEnumMap map, const std::string& key, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; picojson::value result_json = picojson::value(picojson::array()); @@ -937,7 +937,7 @@ PlatformResult CommonNotification::AddTextsArrayToJson(notification_h noti_handl InformationEnumMap map, const std::string& key, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; picojson::value result_json = picojson::value(picojson::array()); @@ -961,7 +961,7 @@ PlatformResult CommonNotification::AddTextsArrayToJson(notification_h noti_handl PlatformResult CommonNotification::AddLedColorToJson(notification_h noti_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; std::string color; @@ -976,7 +976,7 @@ PlatformResult CommonNotification::AddLedColorToJson(notification_h noti_handle, PlatformResult CommonNotification::AddSoundPathToJson(notification_h noti_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; std::string sound_path; @@ -991,7 +991,7 @@ PlatformResult CommonNotification::AddSoundPathToJson(notification_h noti_handle PlatformResult CommonNotification::AddVibrationToJson(notification_h noti_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; bool vibration; @@ -1005,7 +1005,7 @@ PlatformResult CommonNotification::AddVibrationToJson(notification_h noti_handle PlatformResult CommonNotification::AddAppControlInfoToJson(notification_h noti_handle, app_control_h app_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::object& out = *out_ptr; if (app_handle) { @@ -1029,7 +1029,7 @@ PlatformResult CommonNotification::AddAppControlInfoToJson(notification_h noti_h PlatformResult CommonNotification::InitNotiFromJson(const picojson::object& noti_obj, const std::string& type_key, bool is_update, notification_h* noti_handle) { - LoggerD("Enter"); + ScopeLogger(); notification_h tmp_noti = nullptr; const std::string& status_type = FromJson(noti_obj, type_key.c_str()); @@ -1059,7 +1059,7 @@ PlatformResult CommonNotification::InitNotiFromJson(const picojson::object& noti PlatformResult CommonNotification::SetCommonMembersFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); PlatformResult status = SetText(noti_handle, NOTIFICATION_TEXT_TYPE_TITLE, FromJson(noti_obj, "title")); @@ -1074,7 +1074,7 @@ PlatformResult CommonNotification::SetPathFromJson(const picojson::value& noti_v notification_image_type_e type, const std::string& key, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); if (noti_value.contains(key) && !IsNull(noti_obj, key.c_str())) { const std::string& value_str = FromJson(noti_obj, key.c_str()); @@ -1088,7 +1088,7 @@ PlatformResult CommonNotification::SetPathFromJson(const picojson::value& noti_v PlatformResult CommonNotification::SetLedColorFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); if (noti_value.contains("ledColor") && !IsNull(noti_obj, "ledColor")) { std::string color_str = FromJson(noti_obj, "ledColor"); @@ -1124,7 +1124,7 @@ PlatformResult CommonNotification::SetLedColorFromJson(const picojson::value& no PlatformResult CommonNotification::SetLedOnPeriodFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); unsigned long on_period = static_cast(FromJson(noti_obj, "ledOnPeriod")); @@ -1143,7 +1143,7 @@ PlatformResult CommonNotification::SetLedOnPeriodFromJson(const picojson::value& PlatformResult CommonNotification::SetLedOffPeriodFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); unsigned long off_period = static_cast(FromJson(noti_obj, "ledOffPeriod")); unsigned long on_period = 0; @@ -1161,7 +1161,7 @@ PlatformResult CommonNotification::SetLedOffPeriodFromJson(const picojson::value PlatformResult CommonNotification::SetProgressTypeAndValueFromJson( const picojson::value& noti_value, bool is_update, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); // progressType @@ -1183,7 +1183,7 @@ PlatformResult CommonNotification::SetProgressTypeAndValueFromJson( PlatformResult CommonNotification::SetAppControlInfoFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); app_control_h app_control = nullptr; @@ -1215,7 +1215,7 @@ PlatformResult CommonNotification::SetAppControlInfoFromJson(const picojson::val PlatformResult CommonNotification::SetEventsNumberFromJson(const picojson::value& noti_value, const std::string& key, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); if (noti_value.contains(key) && !IsNull(noti_obj, key.c_str())) { @@ -1229,7 +1229,7 @@ PlatformResult CommonNotification::SetEventsNumberFromJson(const picojson::value PlatformResult CommonNotification::SetDetailInfosFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); if (noti_value.contains("detailInfo") && !IsNull(noti_obj, "detailInfo")) { const picojson::array& array = FromJson(noti_obj, "detailInfo"); @@ -1257,7 +1257,7 @@ PlatformResult CommonNotification::SetDetailInfosFromJson(const picojson::value& PlatformResult CommonNotification::SetVibrationFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); bool vibration = FromJson(noti_obj, "vibration"); @@ -1284,7 +1284,7 @@ PlatformResult CommonNotification::SetVibrationFromJson(const picojson::value& n PlatformResult CommonNotification::SetSoundPathFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); if (noti_value.contains("soundPath") && !IsNull(noti_obj, "soundPath")) { @@ -1301,7 +1301,7 @@ PlatformResult CommonNotification::SetSoundPathFromJson(const picojson::value& n PlatformResult CommonNotification::SetPathsArrayFromJson(const picojson::value& noti_value, ImageEnumMap map, const std::string& key, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); if (noti_value.contains(key) && !IsNull(noti_obj, key.c_str())) { @@ -1328,7 +1328,7 @@ PlatformResult CommonNotification::SetTextsArrayFromJson(const picojson::value& InformationEnumMap map, const std::string& key, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); if (noti_value.contains(key) && !IsNull(noti_obj, key.c_str())) { @@ -1354,7 +1354,7 @@ PlatformResult CommonNotification::SetTextFromJson(const picojson::value& noti_v notification_text_type_e type, const std::string& key, notification_h noti_handle) { - LoggerD("Entered"); + ScopeLogger(); const picojson::object& noti_obj = noti_value.get(); if (noti_value.contains(key) && !IsNull(noti_obj, key.c_str())) { diff --git a/src/notification/notification_instance.cc b/src/notification/notification_instance.cc index 05851dd..433830a 100644 --- a/src/notification/notification_instance.cc +++ b/src/notification/notification_instance.cc @@ -205,7 +205,7 @@ void NotificationInstance::NotificationManagerStopLEDCustomEffect(const picojson void NotificationInstance::NotificationManagerSaveTemplate(const picojson::value& args, picojson::object& out) { - LoggerD("Enter"); + ScopeLogger(); CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out); PlatformResult status = manager_->SaveTemplate(args.get()); @@ -219,7 +219,7 @@ void NotificationInstance::NotificationManagerSaveTemplate(const picojson::value void NotificationInstance::NotificationManagerCreateFromTemplate(const picojson::value& args, picojson::object& out) { - LoggerD("Enter"); + ScopeLogger(); CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out); picojson::value val{picojson::object{}}; diff --git a/src/notification/notification_manager.cc b/src/notification/notification_manager.cc index a0b2607..a7b3418 100644 --- a/src/notification/notification_manager.cc +++ b/src/notification/notification_manager.cc @@ -59,7 +59,7 @@ PlatformResult NotificationManager::Post(const picojson::object& args, picojson: PlatformResult NotificationManager::PostUserNoti(const picojson::object& args, picojson::object& out) { - LoggerD("Enter"); + ScopeLogger(); return UserNotification::PostUserNotification(args, false, &out); } @@ -69,7 +69,7 @@ PlatformResult NotificationManager::Update(const picojson::object& args) { } PlatformResult NotificationManager::UpdateUserNoti(const picojson::object& args) { - LoggerD("Enter"); + ScopeLogger(); return UserNotification::PostUserNotification(args, true, nullptr); } @@ -255,7 +255,7 @@ PlatformResult NotificationManager::StopLEDCustomEffect() { } common::PlatformResult NotificationManager::SaveTemplate(const picojson::object& args) { - LoggerD("Enter"); + ScopeLogger(); std::string name = FromJson(args, "name"); notification_h noti_handle = nullptr; int ret; @@ -294,7 +294,7 @@ common::PlatformResult NotificationManager::SaveTemplate(const picojson::object& common::PlatformResult NotificationManager::CreateFromTemplate(const picojson::object& args, picojson::object& out) { - LoggerD("Enter"); + ScopeLogger(); std::string name = FromJson(args, "name"); notification_h noti_handle = nullptr; diff --git a/src/notification/status_notification.cc b/src/notification/status_notification.cc index c8bbea5..f4b002d 100644 --- a/src/notification/status_notification.cc +++ b/src/notification/status_notification.cc @@ -176,7 +176,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::value& PlatformResult StatusNotification::PostStatusNotification(const picojson::object& args, bool is_update, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); return PostNotification(args, is_update, out_ptr, GetNotiHandleFromJson); } diff --git a/src/notification/user_notification.cc b/src/notification/user_notification.cc index 1a73a2f..d7960de 100644 --- a/src/notification/user_notification.cc +++ b/src/notification/user_notification.cc @@ -33,7 +33,7 @@ UserNotification::~UserNotification() { PlatformResult UserNotification::ToJson(int id, notification_h noti_handle, app_control_h app_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); PlatformResult ret = AddCommonMembersToJson(id, noti_handle, out_ptr); CHECK_ERROR(ret); @@ -65,7 +65,7 @@ PlatformResult UserNotification::ToJson(int id, notification_h noti_handle, PlatformResult UserNotification::GetNotiHandleFromJson(const picojson::value& noti_val, bool is_update, notification_h* noti_handle) { - LoggerD("Enter"); + ScopeLogger(); picojson::object noti_obj = noti_val.get(); notification_h tmp_noti = nullptr; @@ -102,14 +102,14 @@ PlatformResult UserNotification::GetNotiHandleFromJson(const picojson::value& no PlatformResult UserNotification::PostUserNotification(const picojson::object& args, bool is_update, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); return PostNotification(args, is_update, out_ptr, GetNotiHandleFromJson); } PlatformResult UserNotification::AddTextContentsToJson(notification_h noti_handle, std::string noti_type_str, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::value text_contents = picojson::value(picojson::object()); picojson::object& text_contents_obj = text_contents.get(); @@ -142,7 +142,7 @@ PlatformResult UserNotification::AddTextContentsToJson(notification_h noti_handl PlatformResult UserNotification::AddImagesToJson(notification_h noti_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::value images_contents = picojson::value(picojson::object()); picojson::object& images_contents_obj = images_contents.get(); @@ -183,7 +183,7 @@ PlatformResult UserNotification::AddImagesToJson(notification_h noti_handle, PlatformResult UserNotification::AddThumbnailsToJson(notification_h noti_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::value thumbnails_contents = picojson::value(picojson::object()); picojson::object& thumbnails_contents_obj = thumbnails_contents.get(); @@ -210,7 +210,7 @@ PlatformResult UserNotification::AddThumbnailsToJson(notification_h noti_handle, PlatformResult UserNotification::AddActionsToJson(notification_h noti_handle, app_control_h app_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::value actions_contents = picojson::value(picojson::object()); picojson::object& actions_contents_obj = actions_contents.get(); @@ -233,7 +233,7 @@ PlatformResult UserNotification::AddActionsToJson(notification_h noti_handle, PlatformResult UserNotification::AddGroupContentsToJson(notification_h noti_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::value group_contents = picojson::value(picojson::object()); picojson::object& group_contents_obj = group_contents.get(); @@ -260,7 +260,7 @@ PlatformResult UserNotification::AddGroupContentsToJson(notification_h noti_hand PlatformResult UserNotification::AddLedsToJson(notification_h noti_handle, picojson::object* out_ptr) { - LoggerD("Enter"); + ScopeLogger(); picojson::value leds_contents = picojson::value(picojson::object()); picojson::object& leds_contents_obj = leds_contents.get(); @@ -280,7 +280,7 @@ PlatformResult UserNotification::AddLedsToJson(notification_h noti_handle, PlatformResult UserNotification::SetTextContentsFromJson(const picojson::value& noti_value, bool is_update, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); if (noti_value.contains("textContents") && noti_value.get("textContents").is()) { LoggerD("nullable member textContents is present - parsing it"); @@ -315,7 +315,7 @@ PlatformResult UserNotification::SetTextContentsFromJson(const picojson::value& PlatformResult UserNotification::SetImagesFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); if (noti_value.contains("images") && noti_value.get("images").is()) { LoggerD("nullable member images is present - parsing it"); const picojson::value& images_value = noti_value.get("images"); @@ -355,7 +355,7 @@ PlatformResult UserNotification::SetImagesFromJson(const picojson::value& noti_v PlatformResult UserNotification::SetThumbnailsFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); if (noti_value.contains("thumbnails") && noti_value.get("thumbnails").is()) { LoggerD("nullable member thumbnails is present - parsing it"); @@ -381,7 +381,7 @@ PlatformResult UserNotification::SetThumbnailsFromJson(const picojson::value& no PlatformResult UserNotification::SetActionsFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); if (noti_value.contains("actions") && noti_value.get("actions").is()) { LoggerD("nullable member actions is present - parsing it"); @@ -404,7 +404,7 @@ PlatformResult UserNotification::SetActionsFromJson(const picojson::value& noti_ PlatformResult UserNotification::SetGroupContentsFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); if (noti_value.contains("groupContents") && noti_value.get("groupContents").is()) { @@ -432,7 +432,7 @@ PlatformResult UserNotification::SetGroupContentsFromJson(const picojson::value& PlatformResult UserNotification::SetLedsFromJson(const picojson::value& noti_value, notification_h noti_handle) { - LoggerD("Enter"); + ScopeLogger(); if (noti_value.contains("leds") && noti_value.get("leds").is()) { LoggerD("nullable member leds is present - parsing it"); -- 2.7.4