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/vehicle_info_plugin/src/commands | |
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/vehicle_info_plugin/src/commands')
30 files changed, 168 insertions, 124 deletions
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc index b8d1b3a100..88884e365a 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIVehicleDataNotification::OnVIVehicleDataNotification( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -50,7 +52,7 @@ OnVIVehicleDataNotification::OnVIVehicleDataNotification( OnVIVehicleDataNotification::~OnVIVehicleDataNotification() {} void OnVIVehicleDataNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // prepare SmartObject for mobile factory (*message_)[strings::params][strings::function_id] = diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc index ae64c74f26..95999c76f9 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIDiagnosticMessageRequest::VIDiagnosticMessageRequest( const app_mngr::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -49,7 +51,7 @@ VIDiagnosticMessageRequest::VIDiagnosticMessageRequest( VIDiagnosticMessageRequest::~VIDiagnosticMessageRequest() {} void VIDiagnosticMessageRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc index 6482d97d10..4ee6e1e495 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIDiagnosticMessageResponse::VIDiagnosticMessageResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -50,7 +52,7 @@ VIDiagnosticMessageResponse::VIDiagnosticMessageResponse( VIDiagnosticMessageResponse::~VIDiagnosticMessageResponse() {} void VIDiagnosticMessageResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc index 620ee4c3e4..6b312c826d 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIGetDTCsRequest::VIGetDTCsRequest( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -49,7 +51,7 @@ VIGetDTCsRequest::VIGetDTCsRequest( VIGetDTCsRequest::~VIGetDTCsRequest() {} void VIGetDTCsRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc index 64e948a4e1..b84e67d7c5 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIGetDTCsResponse::VIGetDTCsResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -50,7 +52,7 @@ VIGetDTCsResponse::VIGetDTCsResponse( VIGetDTCsResponse::~VIGetDTCsResponse() {} void VIGetDTCsResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc index eded6c685b..a3e3a83f62 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIGetVehicleDataRequest::VIGetVehicleDataRequest( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -51,7 +53,7 @@ VIGetVehicleDataRequest::VIGetVehicleDataRequest( VIGetVehicleDataRequest::~VIGetVehicleDataRequest() {} void VIGetVehicleDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto& rpc_spec_vehicle_data = MessageHelper::vehicle_data(); auto& msg_params = (*message_)[strings::msg_params]; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc index 763ddf1cfa..0ef6a97e91 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc @@ -39,6 +39,8 @@ namespace vehicle_info_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIGetVehicleDataResponse::VIGetVehicleDataResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -51,7 +53,7 @@ VIGetVehicleDataResponse::VIGetVehicleDataResponse( VIGetVehicleDataResponse::~VIGetVehicleDataResponse() {} void VIGetVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc index e8df12ca5c..26a9990079 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIGetVehicleTypeRequest::VIGetVehicleTypeRequest( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -49,13 +51,13 @@ VIGetVehicleTypeRequest::VIGetVehicleTypeRequest( VIGetVehicleTypeRequest::~VIGetVehicleTypeRequest() {} void VIGetVehicleTypeRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void VIGetVehicleTypeRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::VehicleInfo_GetVehicleType); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc index dcc73d26f3..dbd1b48033 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIGetVehicleTypeResponse::VIGetVehicleTypeResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -48,7 +50,7 @@ VIGetVehicleTypeResponse::VIGetVehicleTypeResponse( VIGetVehicleTypeResponse::~VIGetVehicleTypeResponse() {} void VIGetVehicleTypeResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto result_code = static_cast<hmi_apis::Common_Result::eType>( (*message_)[strings::params][hmi_response::code].asInt()); @@ -57,8 +59,7 @@ void VIGetVehicleTypeResponse::Run() { hmi_apis::FunctionID::VehicleInfo_GetVehicleType); if (hmi_apis::Common_Result::SUCCESS != result_code) { - LOG4CXX_DEBUG(logger_, - "Request was not successful. Don't change HMI capabilities"); + SDL_LOG_DEBUG("Request was not successful. Don't change HMI capabilities"); return; } @@ -70,8 +71,8 @@ void VIGetVehicleTypeResponse::Run() { hmi_interface::vehicle_info, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR( - logger_, "Failed to save VehicleInfo.GetVehicleType response to cache"); + SDL_LOG_ERROR( + "Failed to save VehicleInfo.GetVehicleType response to cache"); } } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc index 3525be059d..578f650e98 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc @@ -42,6 +42,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIIsReadyRequest::VIIsReadyRequest( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -55,18 +57,18 @@ VIIsReadyRequest::VIIsReadyRequest( VIIsReadyRequest::~VIIsReadyRequest() {} void VIIsReadyRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); subscribe_on_event(hmi_apis::FunctionID::VehicleInfo_IsReady, correlation_id()); SendRequest(); } void VIIsReadyRequest::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::VehicleInfo_IsReady: { - LOG4CXX_DEBUG(logger_, "VehicleInfo_IsReady event"); + SDL_LOG_DEBUG("VehicleInfo_IsReady event"); unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_IsReady); const bool is_available = app_mngr::commands::ChangeInterfaceState( application_manager_, @@ -78,8 +80,7 @@ void VIIsReadyRequest::on_event(const event_engine::Event& event) { policy_handler_.OnVIIsReady(); if (!app_mngr::commands::CheckAvailabilityHMIInterfaces( application_manager_, HmiInterfaces::HMI_INTERFACE_VehicleInfo)) { - LOG4CXX_INFO( - logger_, + SDL_LOG_INFO( "HmiInterfaces::HMI_INTERFACE_VehicleInfo isn't available"); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::VehicleInfo_GetVehicleType); @@ -90,7 +91,7 @@ void VIIsReadyRequest::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()); return; } } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc index 349a1137ce..b40ecc51db 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIIsReadyResponse::VIIsReadyResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -48,7 +50,7 @@ VIIsReadyResponse::VIIsReadyResponse( VIIsReadyResponse::~VIIsReadyResponse() {} void VIIsReadyResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_IsReady); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc index 47373bb4bf..529ed248d0 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIReadDIDRequest::VIReadDIDRequest( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -49,7 +51,7 @@ VIReadDIDRequest::VIReadDIDRequest( VIReadDIDRequest::~VIReadDIDRequest() {} void VIReadDIDRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc index 7c2db1e875..09abb3c9fc 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIReadDIDResponse::VIReadDIDResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -49,7 +51,7 @@ VIReadDIDResponse::VIReadDIDResponse( VIReadDIDResponse::~VIReadDIDResponse() {} void VIReadDIDResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_ReadDID); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc index 4c5f067d0d..12a938fe08 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VISubscribeVehicleDataRequest::VISubscribeVehicleDataRequest( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -51,7 +53,7 @@ VISubscribeVehicleDataRequest::VISubscribeVehicleDataRequest( VISubscribeVehicleDataRequest::~VISubscribeVehicleDataRequest() {} void VISubscribeVehicleDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto& rpc_spec_vehicle_data = MessageHelper::vehicle_data(); auto& msg_params = (*message_)[strings::msg_params]; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc index 061e13c766..5fbd9a7f82 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc @@ -37,6 +37,8 @@ namespace vehicle_info_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VISubscribeVehicleDataResponse::VISubscribeVehicleDataResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -49,7 +51,7 @@ VISubscribeVehicleDataResponse::VISubscribeVehicleDataResponse( VISubscribeVehicleDataResponse::~VISubscribeVehicleDataResponse() {} void VISubscribeVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc index aa24ac7375..d9c9b0729a 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIUnsubscribeVehicleDataRequest::VIUnsubscribeVehicleDataRequest( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -51,7 +53,7 @@ VIUnsubscribeVehicleDataRequest::VIUnsubscribeVehicleDataRequest( VIUnsubscribeVehicleDataRequest::~VIUnsubscribeVehicleDataRequest() {} void VIUnsubscribeVehicleDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto& rpc_spec_vehicle_data = MessageHelper::vehicle_data(); auto& msg_params = (*message_)[strings::msg_params]; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc index 01fc521b10..ea1ab16d0d 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc @@ -37,6 +37,8 @@ namespace vehicle_info_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VIUnsubscribeVehicleDataResponse::VIUnsubscribeVehicleDataResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -49,7 +51,7 @@ VIUnsubscribeVehicleDataResponse::VIUnsubscribeVehicleDataResponse( VIUnsubscribeVehicleDataResponse::~VIUnsubscribeVehicleDataResponse() {} void VIUnsubscribeVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc index ef6c284faf..762528c51b 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc @@ -44,6 +44,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DiagnosticMessageRequest::DiagnosticMessageRequest( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -56,12 +58,12 @@ DiagnosticMessageRequest::DiagnosticMessageRequest( DiagnosticMessageRequest::~DiagnosticMessageRequest() {} void DiagnosticMessageRequest::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; } @@ -77,8 +79,7 @@ void DiagnosticMessageRequest::Run() { if (supported_diag_modes.end() == std::find(supported_diag_modes.begin(), supported_diag_modes.end(), msg_diagnostic_mode)) { - LOG4CXX_ERROR(logger_, - "Received diagnostic mode " << msg_diagnostic_mode + SDL_LOG_ERROR("Received diagnostic mode " << msg_diagnostic_mode << " is not supported."); SendResponse(false, mobile_apis::Result::REJECTED, @@ -96,7 +97,7 @@ void DiagnosticMessageRequest::Run() { } void DiagnosticMessageRequest::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()) { @@ -116,7 +117,7 @@ void DiagnosticMessageRequest::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()); return; } } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc index f5ccc4d0a7..5448d8c48b 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DiagnosticMessageResponse::DiagnosticMessageResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -51,7 +53,7 @@ DiagnosticMessageResponse::DiagnosticMessageResponse( DiagnosticMessageResponse::~DiagnosticMessageResponse() {} void DiagnosticMessageResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc index dfa1cf305b..2f236dd8b2 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc @@ -42,6 +42,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetDTCsRequest::GetDTCsRequest( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -54,13 +56,13 @@ GetDTCsRequest::GetDTCsRequest( GetDTCsRequest::~GetDTCsRequest() {} void GetDTCsRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application( (*message_)[strings::params][strings::connection_key].asUInt()); if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -83,7 +85,7 @@ void GetDTCsRequest::Run() { } void GetDTCsRequest::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()) { @@ -105,7 +107,7 @@ void GetDTCsRequest::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()); return; } } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc index 33945a2f00..6631274c0d 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetDTCsResponse::GetDTCsResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -51,7 +53,7 @@ GetDTCsResponse::GetDTCsResponse( GetDTCsResponse::~GetDTCsResponse() {} void GetDTCsResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc index d15cf6a580..e5656d60c5 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc @@ -47,6 +47,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + namespace str = strings; GetVehicleDataRequest::GetVehicleDataRequest( @@ -62,12 +64,12 @@ GetVehicleDataRequest::GetVehicleDataRequest( GetVehicleDataRequest::~GetVehicleDataRequest() {} void GetVehicleDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "No such application : " << connection_key()); + SDL_LOG_ERROR("No such application : " << connection_key()); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -110,7 +112,7 @@ void GetVehicleDataRequest::Run() { } void GetVehicleDataRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject message = event.smart_object(); switch (event.id()) { @@ -178,7 +180,7 @@ void GetVehicleDataRequest::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()); return; } } @@ -188,7 +190,7 @@ bool GetVehicleDataRequest::CheckFrequency(Application& app) { if (app.AreCommandLimitsExceeded( static_cast<mobile_apis::FunctionID::eType>(function_id()), application_manager::TLimitSource::CONFIG_FILE)) { - LOG4CXX_ERROR(logger_, "GetVehicleData frequency is too high."); + SDL_LOG_ERROR("GetVehicleData frequency is too high."); return false; } return true; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc index 60a44745a5..c263acd33f 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetVehicleDataResponse::GetVehicleDataResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -52,7 +54,7 @@ GetVehicleDataResponse::GetVehicleDataResponse( GetVehicleDataResponse::~GetVehicleDataResponse() {} void GetVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc index 79134cae40..e336b778ff 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc @@ -45,6 +45,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVehicleDataNotification::OnVehicleDataNotification( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -58,7 +60,7 @@ OnVehicleDataNotification::OnVehicleDataNotification( OnVehicleDataNotification::~OnVehicleDataNotification() {} void OnVehicleDataNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::vector<ApplicationSharedPtr> notify_apps; std::vector<ApplicationSharedPtr>::iterator notified_app_it = @@ -70,7 +72,7 @@ void OnVehicleDataNotification::Run() { const auto& param_names = (*message_)[strings::msg_params].enumerate(); for (const auto& name : param_names) { - LOG4CXX_DEBUG(logger_, "vehicle_data name: " << name); + SDL_LOG_DEBUG("vehicle_data name: " << name); auto vehicle_data_value = (*message_)[strings::msg_params][name].asInt(); application_manager_.IviInfoUpdated(name, vehicle_data_value); @@ -84,7 +86,7 @@ void OnVehicleDataNotification::Run() { application_manager_.applications(), subscribed_to_ivi_predicate); for (const auto& app : applications) { if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); continue; } notified_app_it = find(notify_apps.begin(), notify_apps.end(), app); @@ -101,14 +103,12 @@ void OnVehicleDataNotification::Run() { } } - LOG4CXX_DEBUG(logger_, - "Number of Notifications to be send: " << notify_apps.size()); + SDL_LOG_DEBUG("Number of Notifications to be send: " << notify_apps.size()); for (size_t idx = 0; idx < notify_apps.size(); idx++) { - LOG4CXX_INFO(logger_, - "Send OnVehicleData PRNDL notification to " - << notify_apps[idx]->name().c_str() << " application id " - << notify_apps[idx]->app_id()); + SDL_LOG_INFO("Send OnVehicleData PRNDL notification to " + << notify_apps[idx]->name().c_str() << " application id " + << notify_apps[idx]->app_id()); (*message_)[strings::params][strings::connection_key] = notify_apps[idx]->app_id(); (*message_)[strings::msg_params] = appSO[idx]; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc index c090df7852..c718d18965 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc @@ -43,6 +43,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ReadDIDRequest::ReadDIDRequest( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -55,19 +57,18 @@ ReadDIDRequest::ReadDIDRequest( ReadDIDRequest::~ReadDIDRequest() {} void ReadDIDRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); uint32_t app_id = (*message_)[strings::params][strings::connection_key].asUInt(); ApplicationSharedPtr app = application_manager_.application(app_id); - LOG4CXX_INFO( - logger_, + SDL_LOG_INFO( "Correlation_id :" - << (*message_)[strings::params][strings::correlation_id].asUInt()); + << (*message_)[strings::params][strings::correlation_id].asUInt()); if (!app) { - LOG4CXX_ERROR(logger_, "An application is not registered."); + SDL_LOG_ERROR("An application is not registered."); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -75,13 +76,13 @@ void ReadDIDRequest::Run() { if (app->AreCommandLimitsExceeded( static_cast<mobile_apis::FunctionID::eType>(function_id()), application_manager::TLimitSource::CONFIG_FILE)) { - LOG4CXX_ERROR(logger_, "ReadDID frequency is too high."); + SDL_LOG_ERROR("ReadDID frequency is too high."); SendResponse(false, mobile_apis::Result::REJECTED); return; } if ((*message_)[strings::msg_params][strings::did_location].empty()) { - LOG4CXX_ERROR(logger_, "INVALID_DATA"); + SDL_LOG_ERROR("INVALID_DATA"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -99,7 +100,7 @@ void ReadDIDRequest::Run() { } void ReadDIDRequest::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()) { @@ -120,7 +121,7 @@ void ReadDIDRequest::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()); return; } } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc index 42e7fc1ba9..806aeb611c 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ReadDIDResponse::ReadDIDResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -51,7 +53,7 @@ ReadDIDResponse::ReadDIDResponse( ReadDIDResponse::~ReadDIDResponse() {} void ReadDIDResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc index 29818232c0..d51790ea55 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc @@ -42,6 +42,8 @@ namespace vehicle_info_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SubscribeVehicleDataRequest::SubscribeVehicleDataRequest( const application_manager::commands::MessageSharedPtr& message, VehicleInfoCommandParams params) @@ -55,12 +57,12 @@ SubscribeVehicleDataRequest::SubscribeVehicleDataRequest( SubscribeVehicleDataRequest::~SubscribeVehicleDataRequest() {} void SubscribeVehicleDataRequest::Run() { - 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"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -90,13 +92,13 @@ void SubscribeVehicleDataRequest::Run() { } void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace helpers; const smart_objects::SmartObject& message = event.smart_object(); if (hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData != event.id()) { - LOG4CXX_ERROR(logger_, "Received unknown event."); + SDL_LOG_ERROR("Received unknown event " << event.id()); return; } EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); @@ -104,7 +106,7 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { application_manager_.application(CommandRequestImpl::connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer."); + SDL_LOG_ERROR("NULL pointer."); return; } @@ -134,7 +136,7 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { const auto& converted_name = ConvertResponseToRequestName(param); if (vi_waiting_for_subscribe_.end() == vi_waiting_for_subscribe_.find(converted_name)) { - LOG4CXX_DEBUG(logger_, "erase " << converted_name); + SDL_LOG_DEBUG("erase " << converted_name); converted_msg_params.erase(param); } } @@ -184,8 +186,7 @@ bool SubscribeVehicleDataRequest::CheckSubscriptionStatus( std::string vi_name, const smart_objects::SmartObject& msg_params) { const auto subscribed_items = msg_params.enumerate(); if (subscribed_items.end() == subscribed_items.find(vi_name)) { - LOG4CXX_WARN(logger_, - vi_name << " is waiting to be subscribed, but missing in " + SDL_LOG_WARN(vi_name << " is waiting to be subscribed, but missing in " "vehicle response."); return false; } @@ -193,8 +194,7 @@ bool SubscribeVehicleDataRequest::CheckSubscriptionStatus( auto res_code = msg_params[vi_name][strings::result_code].asInt(); if (VD_ResultCode::VDRC_SUCCESS != res_code && VD_ResultCode::VDRC_DATA_ALREADY_SUBSCRIBED != res_code) { - LOG4CXX_WARN(logger_, - "Subscription to " << vi_name << " for " << connection_key() + SDL_LOG_WARN("Subscription to " << vi_name << " for " << connection_key() << " failed."); return false; } @@ -203,7 +203,7 @@ bool SubscribeVehicleDataRequest::CheckSubscriptionStatus( bool SubscribeVehicleDataRequest::SubscribePendingVehicleData( ApplicationSharedPtr app, smart_objects::SmartObject& msg_params) { - LOG4CXX_DEBUG(logger_, "Subscribing to all pending VehicleData"); + SDL_LOG_DEBUG("Subscribing to all pending VehicleData"); std::set<hmi_apis::Common_VehicleDataResultCode::eType> skiped_result_codes( {VD_ResultCode::VDRC_TRUNCATED_DATA, @@ -245,7 +245,7 @@ bool SubscribeVehicleDataRequest::Init() { void SubscribeVehicleDataRequest::AddAlreadySubscribedVI( smart_objects::SmartObject& msg_params) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace mobile_apis; for (const auto& item : vi_already_subscribed_by_this_app_) { @@ -272,7 +272,7 @@ struct SubscribedToIVIPredicate { bool SubscribeVehicleDataRequest::IsSomeoneSubscribedFor( const std::string& param_name) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SubscribedToIVIPredicate finder(param_name); DataAccessor<ApplicationSet> accessor = application_manager_.applications(); ApplicationSetConstIt it = std::find_if( @@ -298,11 +298,10 @@ void SubscribeVehicleDataRequest::CheckVISubscriptions( [this, &out_response_params]( const std::string& key_name, const mobile_apis::VehicleDataType::eType vd_type) { - LOG4CXX_DEBUG( - logger_, - "App with connection key " - << connection_key() - << " is subscribed already for VehicleData: " << key_name); + SDL_LOG_DEBUG("App with connection key " + << connection_key() + << " is subscribed already for VehicleData: " + << key_name); vi_already_subscribed_by_this_app_.insert(key_name); out_response_params[key_name][strings::data_type] = vd_type; out_response_params[key_name][strings::result_code] = @@ -314,21 +313,20 @@ void SubscribeVehicleDataRequest::CheckVISubscriptions( const std::string& key_name, const mobile_apis::VehicleDataType::eType vd_type, vehicle_info_plugin::VehicleInfoAppExtension& ext) { - LOG4CXX_DEBUG(logger_, - "There are apps subscribed already for " - "VehicleDataType: " - << key_name); + SDL_LOG_DEBUG( + "There are apps subscribed already for " + "VehicleDataType: " + << key_name); if (!ext.subscribeToVehicleInfo(key_name)) { - LOG4CXX_ERROR( - logger_, "Unable to subscribe for VehicleDataType: " << key_name); + SDL_LOG_ERROR( + "Unable to subscribe for VehicleDataType: " << key_name); return; } - LOG4CXX_DEBUG( - logger_, - "App with connection key " - << connection_key() - << " have been subscribed for VehicleDataType: " << key_name); + SDL_LOG_DEBUG("App with connection key " + << connection_key() + << " have been subscribed for VehicleDataType: " + << key_name); vi_already_subscribed_by_another_apps_.insert(key_name); out_response_params[key_name][strings::data_type] = vd_type; out_response_params[key_name][strings::result_code] = @@ -341,11 +339,9 @@ void SubscribeVehicleDataRequest::CheckVISubscriptions( out_request_params[vi_name] = (*message_)[strings::msg_params][vi_name]; vi_waiting_for_subscribe_.insert(vi_name); - LOG4CXX_DEBUG( - logger_, - "App with connection key " - << connection_key() - << " will be subscribed for VehicleDataType: " << vi_name); + SDL_LOG_DEBUG("App with connection key " + << connection_key() + << " will be subscribed for VehicleDataType: " << vi_name); ++subscribed_items; return true; }; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc index 8330176af6..0527532acc 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc @@ -40,6 +40,8 @@ namespace vehicle_info_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SubscribeVehicleDataResponse::SubscribeVehicleDataResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -52,7 +54,7 @@ SubscribeVehicleDataResponse::SubscribeVehicleDataResponse( SubscribeVehicleDataResponse::~SubscribeVehicleDataResponse() {} void SubscribeVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc index fccf56ecf5..8ffeaf922a 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc @@ -47,6 +47,8 @@ namespace vehicle_info_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UnsubscribeVehicleDataRequest::UnsubscribeVehicleDataRequest( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -60,12 +62,12 @@ UnsubscribeVehicleDataRequest::UnsubscribeVehicleDataRequest( UnsubscribeVehicleDataRequest::~UnsubscribeVehicleDataRequest() {} void UnsubscribeVehicleDataRequest::Run() { - 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"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -82,20 +84,19 @@ void UnsubscribeVehicleDataRequest::Run() { std::set<std::string> custom_vehicle_data; auto app_not_subscribed_response = [this](const std::string& key_name) { - LOG4CXX_DEBUG(logger_, - "App with connection key " - << connection_key() - << " is not subscribed for VehicleData: " << key_name); + SDL_LOG_DEBUG("App with connection key " + << connection_key() + << " is not subscribed for VehicleData: " << key_name); vi_already_unsubscribed_by_this_app_.insert(key_name); response_params_[key_name][strings::result_code] = mobile_apis::VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED; }; auto other_app_subscribed_response = [this](const std::string& key_name) { - LOG4CXX_DEBUG(logger_, - "There are apps still subscribed for " - "VehicleDataType: " - << key_name); + SDL_LOG_DEBUG( + "There are apps still subscribed for " + "VehicleDataType: " + << key_name); vi_still_subscribed_by_another_apps_.insert(key_name); response_params_[key_name][strings::result_code] = mobile_apis::VehicleDataResultCode::VDRC_SUCCESS; @@ -117,9 +118,8 @@ void UnsubscribeVehicleDataRequest::Run() { continue; } - LOG4CXX_DEBUG(logger_, - "Unsubscribed app with connection key " - << connection_key() << " from VehicleDataType: " << name); + SDL_LOG_DEBUG("Unsubscribed app with connection key " + << connection_key() << " from VehicleDataType: " << name); ++unsubscribed_items; @@ -177,13 +177,13 @@ void UnsubscribeVehicleDataRequest::Run() { } void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace helpers; const smart_objects::SmartObject& message = event.smart_object(); if (hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData != event.id()) { - LOG4CXX_ERROR(logger_, "Received unknown event."); + SDL_LOG_ERROR("Received unknown event " << event.id()); return; } EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); @@ -192,7 +192,7 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { application_manager_.application(CommandRequestImpl::connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer."); + SDL_LOG_ERROR("NULL pointer."); return; } @@ -260,7 +260,7 @@ bool UnsubscribeVehicleDataRequest::Init() { bool UnsubscribeVehicleDataRequest::IsSomeoneSubscribedFor( const std::string& param_name) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto conn_key = connection_key(); auto subscribed_to_ivi = [¶m_name, &conn_key](const ApplicationSharedPtr app) { @@ -280,7 +280,7 @@ bool UnsubscribeVehicleDataRequest::IsSomeoneSubscribedFor( void UnsubscribeVehicleDataRequest::AddAlreadyUnsubscribedVI( smart_objects::SmartObject& response) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace mobile_apis; for (const auto& item : vi_already_unsubscribed_by_this_app_) { @@ -297,16 +297,14 @@ bool UnsubscribeVehicleDataRequest::CheckSubscriptionStatus( std::string key, const smart_objects::SmartObject& msg_params) { const auto unsubscribed_items = msg_params.enumerate(); if (unsubscribed_items.end() == unsubscribed_items.find(key)) { - LOG4CXX_WARN(logger_, - key << " is waiting to be unsubscribed, but missing in " + SDL_LOG_WARN(key << " is waiting to be unsubscribed, but missing in " "vehicle response."); return false; } auto res_code = msg_params[key][strings::result_code].asInt(); if (hmi_apis::Common_VehicleDataResultCode::VDRC_SUCCESS != res_code) { - LOG4CXX_WARN(logger_, - "Unubscribing from " << key << " for " << connection_key() + SDL_LOG_WARN("Unubscribing from " << key << " for " << connection_key() << " failed."); return false; } @@ -315,7 +313,7 @@ bool UnsubscribeVehicleDataRequest::CheckSubscriptionStatus( bool UnsubscribeVehicleDataRequest::UnsubscribePendingVehicleData( ApplicationSharedPtr app, const smart_objects::SmartObject& msg_params) { - LOG4CXX_DEBUG(logger_, "Unsubscribing from all pending VehicleData"); + SDL_LOG_DEBUG("Unsubscribing from all pending VehicleData"); for (const auto& vi_name : vi_waiting_for_unsubscribe_) { const auto converted_item = ConvertRequestToResponseName(vi_name); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc index 352239c331..89b5261938 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc @@ -38,6 +38,8 @@ namespace vehicle_info_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UnsubscribeVehicleDataResponse::UnsubscribeVehicleDataResponse( const application_manager::commands::MessageSharedPtr& message, const VehicleInfoCommandParams& params) @@ -50,12 +52,12 @@ UnsubscribeVehicleDataResponse::UnsubscribeVehicleDataResponse( UnsubscribeVehicleDataResponse::~UnsubscribeVehicleDataResponse() {} void UnsubscribeVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // check if response false if (true == (*message_)[strings::msg_params].keyExists(strings::success)) { if ((*message_)[strings::msg_params][strings::success].asBool() == false) { - LOG4CXX_ERROR(logger_, "Success = false"); + SDL_LOG_ERROR("Success = false"); SendResponse(false); return; } |