diff options
author | VladSemenyuk <VSemenyuk@luxoft.com> | 2020-09-01 20:35:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-01 13:35:06 -0400 |
commit | 062d3b0f2a6eb2185d14dc80a885cdfe4860ce23 (patch) | |
tree | 766c4725b8b129cec2d420ff65ae7e9731e91194 /src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc | |
parent | 79fb6408810d776278bf3499c5273eb04159b076 (diff) | |
download | sdl_core-062d3b0f2a6eb2185d14dc80a885cdfe4860ce23.tar.gz |
[SDL 0046] Implement logger abstraction (#3472)
* Implement logger abstraction. Integrate it to SDL.
Create one logger instance for shared libraries
* Rename all logger macros.
* Update src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc
Co-authored-by: Shobhit Adlakha <ShobhitAd@users.noreply.github.com>
* Fix review comments(errors in log messages)
* Fix review coments
* Fix code style
* Add logger variable creation to new commads
* Fix review comment
* Fixe review comment(class imblemtation moved to .cc file)
Co-authored-by: Shobhit Adlakha <ShobhitAd@users.noreply.github.com>
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc | 199 |
1 files changed, 95 insertions, 104 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc index 881c838c1a..3e25a4b094 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc @@ -56,6 +56,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + namespace custom_str = utils::custom_string; uint32_t PerformInteractionRequest::pi_requests_count_ = 0; @@ -108,18 +110,18 @@ bool PerformInteractionRequest::Init() { } void PerformInteractionRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } if (app->is_perform_interaction_active()) { - LOG4CXX_DEBUG(logger_, "Application has active PerformInteraction"); + SDL_LOG_DEBUG("Application has active PerformInteraction"); app_pi_was_active_before_ = true; } @@ -134,9 +136,9 @@ void PerformInteractionRequest::Run() { if ((mobile_apis::InteractionMode::VR_ONLY == interaction_mode_) && (mobile_apis::LayoutMode::KEYBOARD == interaction_layout)) { - LOG4CXX_ERROR(logger_, - "PerformInteraction contains InteractionMode" - "=VR_ONLY and interactionLayout=KEYBOARD"); + SDL_LOG_ERROR( + "PerformInteraction contains InteractionMode" + "=VR_ONLY and interactionLayout=KEYBOARD"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -147,17 +149,17 @@ void PerformInteractionRequest::Run() { if (0 == choice_set_id_list_length) { if (mobile_apis::LayoutMode::KEYBOARD == interaction_layout) { if (mobile_apis::InteractionMode::BOTH == interaction_mode_) { - LOG4CXX_ERROR(logger_, - "interactionChoiceSetIDList is empty," - " InteractionMode=BOTH and" - " interactionLayout=KEYBOARD"); + SDL_LOG_ERROR( + "interactionChoiceSetIDList is empty," + " InteractionMode=BOTH and" + " interactionLayout=KEYBOARD"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } } else { - LOG4CXX_ERROR(logger_, - "interactionChoiceSetIDList is empty" - " and interactionLayout!=KEYBOARD"); + SDL_LOG_ERROR( + "interactionChoiceSetIDList is empty" + " and interactionLayout!=KEYBOARD"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -167,9 +169,9 @@ void PerformInteractionRequest::Run() { app, choice_set_id_list_length, msg_params[strings::interaction_choice_set_id_list])) { - LOG4CXX_ERROR(logger_, - "PerformInteraction has choice sets with " - "duplicated IDs or application does not have choice sets"); + SDL_LOG_ERROR( + "PerformInteraction has choice sets with " + "duplicated IDs or application does not have choice sets"); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } @@ -178,23 +180,21 @@ void PerformInteractionRequest::Run() { if (mobile_apis::Result::INVALID_DATA == MessageHelper::VerifyImageVrHelpItems( msg_params[strings::vr_help], app, application_manager_)) { - LOG4CXX_ERROR(logger_, - "Verification of " << strings::vr_help << " failed."); + SDL_LOG_ERROR("Verification of " << strings::vr_help << " failed."); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } } if (IsWhiteSpaceExist()) { - LOG4CXX_ERROR(logger_, - "Incoming perform interaction has contains \t\n \\t \\n"); + SDL_LOG_ERROR("Incoming perform interaction has contains \t\n \\t \\n"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } switch (interaction_mode_) { case mobile_apis::InteractionMode::BOTH: { - LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH"); + SDL_LOG_DEBUG("Interaction Mode: BOTH"); if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) || !CheckVrHelpItemPositions(app) || !CheckChoiceSetListVRCommands(app)) { @@ -203,7 +203,7 @@ void PerformInteractionRequest::Run() { break; } case mobile_apis::InteractionMode::MANUAL_ONLY: { - LOG4CXX_DEBUG(logger_, "Interaction Mode: MANUAL_ONLY"); + SDL_LOG_DEBUG("Interaction Mode: MANUAL_ONLY"); if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) || !CheckVrHelpItemPositions(app)) { return; @@ -211,7 +211,7 @@ void PerformInteractionRequest::Run() { break; } case mobile_apis::InteractionMode::VR_ONLY: { - LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY"); + SDL_LOG_DEBUG("Interaction Mode: VR_ONLY"); if (!CheckChoiceSetVRSynonyms(app) || !CheckVrHelpItemPositions(app) || !CheckChoiceSetListVRCommands(app)) { return; @@ -219,7 +219,7 @@ void PerformInteractionRequest::Run() { break; } default: { - LOG4CXX_ERROR(logger_, "Unknown interaction mode"); + SDL_LOG_ERROR("Unknown interaction mode"); return; } } @@ -234,18 +234,18 @@ void PerformInteractionRequest::Run() { } void PerformInteractionRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { case hmi_apis::FunctionID::UI_OnResetTimeout: { - LOG4CXX_DEBUG(logger_, "Received UI_OnResetTimeout event"); + SDL_LOG_DEBUG("Received UI_OnResetTimeout event"); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); break; } case hmi_apis::FunctionID::UI_PerformInteraction: { - LOG4CXX_DEBUG(logger_, "Received UI_PerformInteraction event"); + SDL_LOG_DEBUG("Received UI_PerformInteraction event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); ui_response_received_ = true; @@ -257,7 +257,7 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::VR_PerformInteraction: { - LOG4CXX_DEBUG(logger_, "Received VR_PerformInteraction"); + SDL_LOG_DEBUG("Received VR_PerformInteraction"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR); vr_response_received_ = true; @@ -271,15 +271,14 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) { break; } default: { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SDL_LOG_ERROR("Received unknown event " << event.id()); break; } } if (!HasHMIResponsesToWait()) { - LOG4CXX_DEBUG(logger_, - "Send response in interaction mode " - << static_cast<int32_t>(interaction_mode_)); + SDL_LOG_DEBUG("Send response in interaction mode " + << static_cast<int32_t>(interaction_mode_)); if (SetChoiceIdToResponseMsgParams(response_msg_params)) { SendBothModeResponse(response_msg_params); } else { @@ -292,11 +291,11 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) { } void PerformInteractionRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); switch (interaction_mode_) { case mobile_apis::InteractionMode::BOTH: { - LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH"); + SDL_LOG_DEBUG("Interaction Mode: BOTH"); if (true == vr_response_received_) { unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction); DisablePerformInteraction(); @@ -308,21 +307,21 @@ void PerformInteractionRequest::onTimeOut() { break; } case mobile_apis::InteractionMode::VR_ONLY: { - LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY"); + SDL_LOG_DEBUG("Interaction Mode: VR_ONLY"); unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction); DisablePerformInteraction(); CommandRequestImpl::onTimeOut(); break; } case mobile_apis::InteractionMode::MANUAL_ONLY: { - LOG4CXX_DEBUG(logger_, "InteractionMode: MANUAL_ONLY"); + SDL_LOG_DEBUG("InteractionMode: MANUAL_ONLY"); unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction); DisablePerformInteraction(); CommandRequestImpl::onTimeOut(); break; } default: { - LOG4CXX_ERROR(logger_, "INVALID ENUM"); + SDL_LOG_ERROR("INVALID ENUM"); return; } }; @@ -331,7 +330,7 @@ void PerformInteractionRequest::onTimeOut() { bool PerformInteractionRequest::ProcessVRResponse( const smart_objects::SmartObject& message, smart_objects::SmartObject& msg_params) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace hmi_apis; using namespace mobile_apis; using namespace smart_objects; @@ -340,7 +339,7 @@ bool PerformInteractionRequest::ProcessVRResponse( ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return false; } @@ -351,14 +350,14 @@ bool PerformInteractionRequest::ProcessVRResponse( vr_result_code_, Common_Result::ABORTED, Common_Result::TIMED_OUT); if (is_vr_aborted_timeout) { - LOG4CXX_DEBUG(logger_, "VR response aborted"); + SDL_LOG_DEBUG("VR response aborted"); if (InteractionMode::VR_ONLY == interaction_mode_) { - LOG4CXX_DEBUG(logger_, "Aborted or Timeout Send Close Popup"); + SDL_LOG_DEBUG("Aborted or Timeout Send Close Popup"); TerminatePerformInteraction(); SendResponse(false, MessageHelper::HMIToMobileResult(vr_result_code_)); return true; } - LOG4CXX_DEBUG(logger_, "Update timeout for UI"); + SDL_LOG_DEBUG("Update timeout for UI"); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout_); return false; @@ -373,7 +372,7 @@ bool PerformInteractionRequest::ProcessVRResponse( if (hmi_msg_params.keyExists(strings::choice_id)) { const int choice_id = hmi_msg_params[strings::choice_id].asInt(); if (!CheckChoiceIDFromResponse(app, choice_id)) { - LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI"); + SDL_LOG_ERROR("Wrong choiceID was received from HMI"); TerminatePerformInteraction(); SendResponse( false, Result::GENERIC_ERROR, "Wrong choiceID was received from HMI"); @@ -384,7 +383,7 @@ bool PerformInteractionRequest::ProcessVRResponse( if (mobile_apis::InteractionMode::BOTH == interaction_mode_ || mobile_apis::InteractionMode::MANUAL_ONLY == interaction_mode_) { - LOG4CXX_DEBUG(logger_, "Update timeout for UI"); + SDL_LOG_DEBUG("Update timeout for UI"); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout_); } @@ -394,9 +393,8 @@ bool PerformInteractionRequest::ProcessVRResponse( if (is_vr_result_success && InteractionMode::MANUAL_ONLY == interaction_mode_) { - LOG4CXX_DEBUG(logger_, - "VR response is successfull in MANUAL_ONLY mode " - << "Wait for UI response"); + SDL_LOG_DEBUG("VR response is successfull in MANUAL_ONLY mode " + << "Wait for UI response"); // in case MANUAL_ONLY mode VR.PI SUCCESS just return return false; } @@ -407,13 +405,13 @@ bool PerformInteractionRequest::ProcessVRResponse( void PerformInteractionRequest::ProcessUIResponse( const smart_objects::SmartObject& message, smart_objects::SmartObject& msg_params) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace helpers; using namespace smart_objects; ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } @@ -476,7 +474,7 @@ void PerformInteractionRequest::ProcessUIResponse( void PerformInteractionRequest::SendUIPerformInteractionRequest( application_manager::ApplicationSharedPtr const app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject& choice_set_id_list = (*message_)[strings::msg_params][strings::interaction_choice_set_id_list]; @@ -562,7 +560,7 @@ void PerformInteractionRequest::SendUIPerformInteractionRequest( void PerformInteractionRequest::SendVRPerformInteractionRequest( application_manager::ApplicationSharedPtr const app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); @@ -584,7 +582,7 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( smart_objects::SmartObject* choice_set = app->FindChoiceSet(choice_list[i].asInt()); if (!choice_set) { - LOG4CXX_WARN(logger_, "Couldn't found choiceset"); + SDL_LOG_WARN("Couldn't found choiceset"); continue; } msg_params[strings::grammar_id][grammar_id_index++] = @@ -600,9 +598,8 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( MessageHelper::VerifyTtsFiles(help_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_WARN( - logger_, - "MessageHelper::VerifyTtsFiles return " << verification_result); + SDL_LOG_WARN("MessageHelper::VerifyTtsFiles return " + << verification_result); invalid_params.push_back("help_prompt"); } else { msg_params[strings::help_prompt] = help_prompt; @@ -635,7 +632,7 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( } } } else { - LOG4CXX_ERROR(logger_, "Can't found choiceSet!"); + SDL_LOG_ERROR("Can't found choiceSet!"); } } } @@ -648,9 +645,8 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( timeout_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_WARN( - logger_, - "MessageHelper::VerifyTtsFiles return " << verification_result); + SDL_LOG_WARN("MessageHelper::VerifyTtsFiles return " + << verification_result); invalid_params.push_back("timeout_prompt"); } else { msg_params[strings::timeout_prompt] = timeout_prompt; @@ -669,9 +665,8 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( initial_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_WARN( - logger_, - "MessageHelper::VerifyTtsFiles return " << verification_result); + SDL_LOG_WARN("MessageHelper::VerifyTtsFiles return " + << verification_result); invalid_params.push_back("initial_prompt"); } else { msg_params[strings::initial_prompt] = initial_prompt; @@ -703,7 +698,7 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( bool PerformInteractionRequest::CheckChoiceSetMenuNames( application_manager::ApplicationSharedPtr const app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject& choice_list = (*message_)[strings::msg_params][strings::interaction_choice_set_id_list]; @@ -723,7 +718,7 @@ bool PerformInteractionRequest::CheckChoiceSetMenuNames( } if (!i_choice_set || !j_choice_set) { - LOG4CXX_ERROR(logger_, "Invalid ID"); + SDL_LOG_ERROR("Invalid ID"); SendResponse(false, mobile_apis::Result::INVALID_ID); return false; } @@ -740,7 +735,7 @@ bool PerformInteractionRequest::CheckChoiceSetMenuNames( .asString(); if (ii_menu_name == jj_menu_name) { - LOG4CXX_ERROR(logger_, "Choice set has duplicated menu name"); + SDL_LOG_ERROR("Choice set has duplicated menu name"); SendResponse(false, mobile_apis::Result::DUPLICATE_NAME, "Choice set has duplicated menu name"); @@ -756,7 +751,7 @@ bool PerformInteractionRequest::CheckChoiceSetMenuNames( bool PerformInteractionRequest::CheckChoiceSetVRSynonyms( application_manager::ApplicationSharedPtr const app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject& choice_list = (*message_)[strings::msg_params][strings::interaction_choice_set_id_list]; @@ -776,7 +771,7 @@ bool PerformInteractionRequest::CheckChoiceSetVRSynonyms( } if ((!i_choice_set) || (!j_choice_set)) { - LOG4CXX_ERROR(logger_, "Invalid ID"); + SDL_LOG_ERROR("Invalid ID"); SendResponse(false, mobile_apis::Result::INVALID_ID); return false; } @@ -789,9 +784,9 @@ bool PerformInteractionRequest::CheckChoiceSetVRSynonyms( strings::vr_commands) && (*j_choice_set)[strings::choice_set][jj].keyExists( strings::vr_commands))) { - LOG4CXX_DEBUG(logger_, - "One or both sets has missing vr commands, skipping " - "synonym check"); + SDL_LOG_DEBUG( + "One or both sets has missing vr commands, skipping " + "synonym check"); return true; } // choice_set pointer contains SmartObject msg_params @@ -808,7 +803,7 @@ bool PerformInteractionRequest::CheckChoiceSetVRSynonyms( const custom_str::CustomString& vr_cmd_j = jj_vr_commands[jjj].asCustomString(); if (vr_cmd_i.CompareIgnoreCase(vr_cmd_j)) { - LOG4CXX_ERROR(logger_, "Choice set has duplicated VR synonym"); + SDL_LOG_ERROR("Choice set has duplicated VR synonym"); SendResponse(false, mobile_apis::Result::DUPLICATE_NAME, "Choice set has duplicated VR synonym"); @@ -825,10 +820,10 @@ bool PerformInteractionRequest::CheckChoiceSetVRSynonyms( bool PerformInteractionRequest::CheckVrHelpItemPositions( application_manager::ApplicationSharedPtr const app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!(*message_)[strings::msg_params].keyExists(strings::vr_help)) { - LOG4CXX_DEBUG(logger_, strings::vr_help << " is omitted."); + SDL_LOG_DEBUG(strings::vr_help << " is omitted."); return true; } @@ -838,7 +833,7 @@ bool PerformInteractionRequest::CheckVrHelpItemPositions( int32_t position = 1; for (size_t i = 0; i < vr_help.length(); ++i) { if (position != vr_help[i][strings::position].asInt()) { - LOG4CXX_ERROR(logger_, "Non-sequential vrHelp item position"); + SDL_LOG_ERROR("Non-sequential vrHelp item position"); SendResponse(false, mobile_apis::Result::REJECTED, "Non-sequential vrHelp item position"); @@ -850,11 +845,11 @@ bool PerformInteractionRequest::CheckVrHelpItemPositions( } void PerformInteractionRequest::DisablePerformInteraction() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } @@ -870,12 +865,12 @@ void PerformInteractionRequest::DisablePerformInteraction() { } bool PerformInteractionRequest::IsWhiteSpaceExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; str = (*message_)[strings::msg_params][strings::initial_text].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid initial_text syntax check failed"); + SDL_LOG_ERROR("Invalid initial_text syntax check failed"); return true; } @@ -889,7 +884,7 @@ bool PerformInteractionRequest::IsWhiteSpaceExist() { for (; it_ip != it_ip_end; ++it_ip) { str = (*it_ip)[strings::text].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed"); + SDL_LOG_ERROR("Invalid initial_prompt syntax check failed"); return true; } } @@ -905,7 +900,7 @@ bool PerformInteractionRequest::IsWhiteSpaceExist() { for (; it_hp != it_hp_end; ++it_hp) { str = (*it_hp)[strings::text].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid help_prompt syntax check failed"); + SDL_LOG_ERROR("Invalid help_prompt syntax check failed"); return true; } } @@ -921,7 +916,7 @@ bool PerformInteractionRequest::IsWhiteSpaceExist() { for (; it_tp != it_tp_end; ++it_tp) { str = (*it_tp)[strings::text].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid timeout_prompt syntax check failed"); + SDL_LOG_ERROR("Invalid timeout_prompt syntax check failed"); return true; } } @@ -937,15 +932,14 @@ bool PerformInteractionRequest::IsWhiteSpaceExist() { for (; it_vh != it_vh_end; ++it_vh) { str = (*it_vh)[strings::text].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid vr_help syntax check failed"); + SDL_LOG_ERROR("Invalid vr_help syntax check failed"); return true; } if ((*it_vh).keyExists(strings::image)) { str = (*it_vh)[strings::image][strings::value].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid vr_help image value syntax check failed"); + SDL_LOG_ERROR("Invalid vr_help image value syntax check failed"); return true; } } @@ -955,7 +949,7 @@ bool PerformInteractionRequest::IsWhiteSpaceExist() { } void PerformInteractionRequest::TerminatePerformInteraction() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendClosePopupRequestToHMI(); DisablePerformInteraction(); @@ -970,7 +964,7 @@ void PerformInteractionRequest::SendClosePopupRequestToHMI() { bool PerformInteractionRequest::CheckChoiceIDFromResponse( ApplicationSharedPtr app, const int32_t choice_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const DataAccessor<PerformChoiceSetMap> accessor = app->performinteraction_choice_set_map(); const PerformChoiceSetMap& choice_set_map = accessor.GetData(); @@ -998,7 +992,7 @@ bool PerformInteractionRequest::CheckChoiceIDFromResponse( bool PerformInteractionRequest::CheckChoiceSetListVRCommands( ApplicationSharedPtr app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& choice_set_id_list = (*message_)[strings::msg_params][strings::interaction_choice_set_id_list]; @@ -1010,8 +1004,7 @@ bool PerformInteractionRequest::CheckChoiceSetListVRCommands( // this should never ever happen since this was already checked if (choice_set == nullptr) { - LOG4CXX_ERROR( - logger_, + SDL_LOG_ERROR( "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt()); SendResponse(false, mobile_apis::Result::INVALID_ID); return false; @@ -1023,9 +1016,9 @@ bool PerformInteractionRequest::CheckChoiceSetListVRCommands( // if not all choices have vr commands if (vr_status != MessageHelper::ChoiceSetVRCommandsStatus::ALL) { - LOG4CXX_ERROR(logger_, - "PerformInteraction has choice sets with " - "missing vrCommands, not in MANUAL_ONLY mode"); + SDL_LOG_ERROR( + "PerformInteraction has choice sets with " + "missing vrCommands, not in MANUAL_ONLY mode"); SendResponse(false, mobile_apis::Result::INVALID_DATA, "Some choices don't contain VR commands."); @@ -1039,7 +1032,7 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( ApplicationSharedPtr app, const size_t choice_set_id_list_length, const smart_objects::SmartObject& choice_set_id_list) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); size_t choice_list_length = 0; std::set<uint32_t> choice_id_set; @@ -1049,8 +1042,7 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( for (size_t i = 0; i < choice_set_id_list_length; ++i) { choice_set = app->FindChoiceSet(choice_set_id_list[i].asInt()); if (!choice_set) { - LOG4CXX_ERROR( - logger_, + SDL_LOG_ERROR( "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt()); return false; } @@ -1062,10 +1054,9 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( ins_res = choice_id_set.insert(choices_list[k][strings::choice_id].asInt()); if (!ins_res.second) { - LOG4CXX_ERROR(logger_, - "choice with ID " - << choices_list[k][strings::choice_id].asInt() - << " already exists"); + SDL_LOG_ERROR("choice with ID " + << choices_list[k][strings::choice_id].asInt() + << " already exists"); return false; } } @@ -1074,13 +1065,13 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( } const bool PerformInteractionRequest::HasHMIResponsesToWait() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); return !ui_response_received_ || !vr_response_received_; } void PerformInteractionRequest::SendBothModeResponse( const smart_objects::SmartObject& msg_param) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); mobile_apis::Result::eType perform_interaction_result_code = mobile_apis::Result::INVALID_ENUM; app_mngr::commands::ResponseInfo ui_perform_info( @@ -1108,8 +1099,8 @@ mobile_apis::Result::eType PerformInteractionRequest::PrepareResultCodeForResponse( const app_mngr::commands::ResponseInfo& ui_response, const app_mngr::commands::ResponseInfo& vr_response) { - LOG4CXX_DEBUG( - logger_, "InteractionMode = " << static_cast<int32_t>(interaction_mode_)); + SDL_LOG_DEBUG( + "InteractionMode = " << static_cast<int32_t>(interaction_mode_)); auto mobile_vr_result_code = MessageHelper::HMIToMobileResult(vr_result_code_); @@ -1159,7 +1150,7 @@ bool PerformInteractionRequest::PrepareResultForMobileResponse( bool PerformInteractionRequest::SetChoiceIdToResponseMsgParams( ns_smart_device_link::ns_smart_objects::SmartObject& msg_param) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const bool ui_choice_id_valid = INVALID_CHOICE_ID != ui_choice_id_received_; const bool vr_choice_id_valid = INVALID_CHOICE_ID != vr_choice_id_received_; |