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 | |
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')
473 files changed, 3139 insertions, 2662 deletions
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h index 5d85237899..444636ed75 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h @@ -34,6 +34,7 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_PLUGIN_INCLUDE_APP_SERVICE_PLUGIN_APP_SERVICE_RPC_PLUGIN_H #include "application_manager/command_factory.h" +#include "utils/ilogger.h" namespace app_service_rpc_plugin { namespace app_mngr = application_manager; @@ -75,7 +76,8 @@ class AppServiceRpcPlugin : public plugins::RPCPlugin { }; } // namespace app_service_rpc_plugin -extern "C" application_manager::plugin_manager::RPCPlugin* Create(); +extern "C" application_manager::plugin_manager::RPCPlugin* Create( + logger::Logger* logger_instance); extern "C" void Delete(application_manager::plugin_manager::RPCPlugin* data); #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_PLUGIN_INCLUDE_APP_SERVICE_PLUGIN_APP_SERVICE_PLUGIN_H diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc index 87f947d250..5d5e96fdb7 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc @@ -33,7 +33,7 @@ #include "app_service_rpc_plugin/app_service_app_extension.h" #include "app_service_rpc_plugin/app_service_rpc_plugin.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin") +SDL_CREATE_LOG_VARIABLE("AppServiceRpcPlugin") namespace app_service_rpc_plugin { @@ -44,22 +44,22 @@ AppServiceAppExtension::AppServiceAppExtension( : app_mngr::AppExtension(AppServiceAppExtensionUID) , plugin_(plugin) , app_(app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } AppServiceAppExtension::~AppServiceAppExtension() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } bool AppServiceAppExtension::SubscribeToAppService( const std::string app_service_type) { - LOG4CXX_DEBUG(logger_, "Subscribe to app service: " << app_service_type); + SDL_LOG_DEBUG("Subscribe to app service: " << app_service_type); return subscribed_data_.insert(app_service_type).second; } bool AppServiceAppExtension::UnsubscribeFromAppService( const std::string app_service_type) { - LOG4CXX_DEBUG(logger_, app_service_type); + SDL_LOG_DEBUG(app_service_type); auto it = subscribed_data_.find(app_service_type); if (it != subscribed_data_.end()) { subscribed_data_.erase(it); @@ -69,14 +69,13 @@ bool AppServiceAppExtension::UnsubscribeFromAppService( } void AppServiceAppExtension::UnsubscribeFromAppService() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); subscribed_data_.clear(); } bool AppServiceAppExtension::IsSubscribedToAppService( const std::string app_service_type) const { - LOG4CXX_DEBUG(logger_, - "isSubscribedToAppService for type: " << app_service_type); + SDL_LOG_DEBUG("isSubscribedToAppService for type: " << app_service_type); return subscribed_data_.find(app_service_type) != subscribed_data_.end(); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_command_factory.cc index 8ce4d10b6e..ff40b587cb 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_command_factory.cc @@ -32,7 +32,7 @@ #include "app_service_rpc_plugin/app_service_command_factory.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin") +SDL_CREATE_LOG_VARIABLE("AppServiceRpcPlugin") namespace app_service_rpc_plugin { @@ -45,11 +45,11 @@ AppServiceCommandFactory::AppServiceCommandFactory( application_manager, rpc_service, hmi_capabilities, policy_handler)) , mobile_command_factory_(new AppServiceMobileCommandFactory( application_manager, rpc_service, hmi_capabilities, policy_handler)) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } AppServiceCommandFactory::~AppServiceCommandFactory() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } app_mngr::CommandSharedPtr AppServiceCommandFactory::CreateCommand( @@ -66,8 +66,7 @@ app_mngr::CommandSharedPtr AppServiceCommandFactory::CreateCommand( bool AppServiceCommandFactory::IsAbleToProcess( const int32_t function_id, const commands::Command::CommandSource source) const { - LOG4CXX_DEBUG(logger_, - "AppServiceCommandFactory::IsAbleToProcess" << function_id + SDL_LOG_DEBUG("AppServiceCommandFactory::IsAbleToProcess" << function_id << " " << source); return (commands::Command::SOURCE_HMI == source || commands::Command::SOURCE_SDL_TO_HMI == source) diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc index 3090ea8ced..1e468242af 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc @@ -55,7 +55,7 @@ #include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h" #include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin") +SDL_CREATE_LOG_VARIABLE("AppServiceRpcPlugin") namespace app_service_rpc_plugin { namespace strings = app_mngr::strings; @@ -69,7 +69,7 @@ AppServiceHmiCommandFactory::AppServiceHmiCommandFactory( , rpc_service_(rpc_service) , hmi_capabilities_(hmi_capabilities) , policy_handler_(policy_handler) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } app_mngr::CommandSharedPtr AppServiceHmiCommandFactory::CreateCommand( @@ -95,9 +95,8 @@ app_mngr::CommandSharedPtr AppServiceHmiCommandFactory::CreateCommand( } UNUSED(message_type_str); - LOG4CXX_DEBUG(logger_, - "HMICommandFactory::CreateCommand function_id: " - << function_id << ", message type: " << message_type_str); + SDL_LOG_DEBUG("HMICommandFactory::CreateCommand function_id: " + << function_id << ", message type: " << message_type_str); return buildCommandCreator(function_id, message_type, source).create(message); } @@ -105,8 +104,7 @@ app_mngr::CommandSharedPtr AppServiceHmiCommandFactory::CreateCommand( bool AppServiceHmiCommandFactory::IsAbleToProcess( const int32_t function_id, const app_mngr::commands::Command::CommandSource source) const { - LOG4CXX_DEBUG(logger_, - "HMI App Service Plugin IsAbleToProcess: " << function_id); + SDL_LOG_DEBUG("HMI App Service Plugin IsAbleToProcess: " << function_id); UNUSED(source); return buildCommandCreator( function_id, hmi_apis::messageType::INVALID_ENUM, source) @@ -120,8 +118,7 @@ app_mngr::CommandCreator& AppServiceHmiCommandFactory::buildCommandCreator( auto factory = app_mngr::CommandCreatorFactory( application_manager_, rpc_service_, hmi_capabilities_, policy_handler_); - LOG4CXX_DEBUG(logger_, - "buildCommandCreator: " << function_id << " " << source); + SDL_LOG_DEBUG("buildCommandCreator: " << function_id << " " << source); switch (function_id) { case hmi_apis::FunctionID::AppService_PublishAppService: @@ -191,7 +188,7 @@ app_mngr::CommandCreator& AppServiceHmiCommandFactory::buildCommandCreator( : factory.GetCreator< commands::ASGetActiveServiceConsentResponse>(); default: - LOG4CXX_WARN(logger_, "Unsupported HMI function_id: " << function_id); + SDL_LOG_WARN("Unsupported HMI function_id: " << function_id); } return factory.GetCreator<app_mngr::InvalidCommand>(); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc index 5c44fb5fae..4a2fe5c2c9 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc @@ -50,7 +50,7 @@ #include "app_service_rpc_plugin/commands/mobile/unpublish_app_service_request.h" #include "app_service_rpc_plugin/commands/mobile/unpublish_app_service_response.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin") +SDL_CREATE_LOG_VARIABLE("AppServiceRpcPlugin") namespace app_service_rpc_plugin { namespace strings = app_mngr::strings; @@ -64,7 +64,7 @@ AppServiceMobileCommandFactory::AppServiceMobileCommandFactory( , rpc_service_(rpc_service) , hmi_capabilities_(hmi_capabilities) , policy_handler_(policy_handler) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } app_mngr::CommandSharedPtr AppServiceMobileCommandFactory::CreateCommand( @@ -88,9 +88,8 @@ app_mngr::CommandSharedPtr AppServiceMobileCommandFactory::CreateCommand( } UNUSED(message_type_str); - LOG4CXX_DEBUG(logger_, - "HMICommandFactory::CreateCommand function_id: " - << function_id << ", message type: " << message_type_str); + SDL_LOG_DEBUG("HMICommandFactory::CreateCommand function_id: " + << function_id << ", message type: " << message_type_str); return buildCommandCreator(function_id, message_type, source).create(message); } @@ -170,7 +169,7 @@ app_mngr::CommandCreator& AppServiceMobileCommandFactory::buildCommandCreator( } break; default: - LOG4CXX_WARN(logger_, "Unsupported function_id: " << function_id); + SDL_LOG_WARN("Unsupported function_id: " << function_id); } return factory.GetCreator<app_mngr::InvalidCommand>(); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc index 1c3a9c77c5..fd7b03fabc 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc @@ -38,7 +38,7 @@ #include "application_manager/smart_object_keys.h" namespace app_service_rpc_plugin { -CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin") +SDL_CREATE_LOG_VARIABLE("AppServiceRpcPlugin") namespace strings = application_manager::strings; namespace plugins = application_manager::plugin_manager; @@ -109,12 +109,12 @@ void AppServiceRpcPlugin::DeleteSubscriptions( extern "C" __attribute__((visibility("default"))) application_manager::plugin_manager::RPCPlugin* -Create() { +Create(logger::Logger* logger_instance) { + logger::Logger::instance(logger_instance); return new app_service_rpc_plugin::AppServiceRpcPlugin(); } extern "C" __attribute__((visibility("default"))) void Delete( application_manager::plugin_manager::RPCPlugin* data) { delete data; - DELETE_THREAD_LOGGER(app_service_rpc_plugin::logger_); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc index fd7312ca98..d9cf7acf1b 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc @@ -38,6 +38,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASAppServiceActivationRequest::ASAppServiceActivationRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ ASAppServiceActivationRequest::ASAppServiceActivationRequest( ASAppServiceActivationRequest::~ASAppServiceActivationRequest() {} void ASAppServiceActivationRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); AppServiceManager& service_manager = application_manager_.GetAppServiceManager(); smart_objects::SmartObject params = (*message_)[strings::msg_params]; diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_response.cc index c77d3ed381..434fad51e9 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_response.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_response.cc @@ -36,6 +36,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASAppServiceActivationResponse::ASAppServiceActivationResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ ASAppServiceActivationResponse::ASAppServiceActivationResponse( ASAppServiceActivationResponse::~ASAppServiceActivationResponse() {} void ASAppServiceActivationResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToHMI(message_); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_request.cc index b1f3d6fdbf..e80c5f741c 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_request.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_request.cc @@ -36,6 +36,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASGetActiveServiceConsentRequest::ASGetActiveServiceConsentRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ ASGetActiveServiceConsentRequest::ASGetActiveServiceConsentRequest( ASGetActiveServiceConsentRequest::~ASGetActiveServiceConsentRequest() {} void ASGetActiveServiceConsentRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_response.cc index 038c2922ad..5e59c9f3ab 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_response.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_response.cc @@ -36,6 +36,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASGetActiveServiceConsentResponse::ASGetActiveServiceConsentResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ ASGetActiveServiceConsentResponse::ASGetActiveServiceConsentResponse( ASGetActiveServiceConsentResponse::~ASGetActiveServiceConsentResponse() {} void ASGetActiveServiceConsentResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::AppService_GetActiveServiceConsent); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc index e03c0ad15a..32fccb0192 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc @@ -43,6 +43,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASGetAppServiceDataRequestFromHMI::ASGetAppServiceDataRequestFromHMI( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -58,12 +60,12 @@ ASGetAppServiceDataRequestFromHMI::ASGetAppServiceDataRequestFromHMI( ASGetAppServiceDataRequestFromHMI::~ASGetAppServiceDataRequestFromHMI() {} void ASGetAppServiceDataRequestFromHMI::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::string service_type = (*message_)[strings::msg_params][strings::service_type].asString(); - LOG4CXX_DEBUG(logger_, "Get Service Type: " << service_type); + SDL_LOG_DEBUG("Get Service Type: " << service_type); SendProviderRequest(mobile_apis::FunctionID::GetAppServiceDataID, hmi_apis::FunctionID::AppService_GetAppServiceData, @@ -172,8 +174,7 @@ void ASGetAppServiceDataRequestFromHMI::GetMediaImagePaths( bool ASGetAppServiceDataRequestFromHMI::ValidateResponse( smart_objects::SmartObject& message_params) { if (!message_params.keyExists(strings::service_data)) { - LOG4CXX_DEBUG( - logger_, + SDL_LOG_DEBUG( "GASD response received without any service data, passing through"); return true; } @@ -185,8 +186,7 @@ bool ASGetAppServiceDataRequestFromHMI::ValidateResponse( auto service = application_manager_.GetAppServiceManager().FindServiceByID(service_id); if (!service) { - LOG4CXX_ERROR(logger_, - "GASD response received with an unpublished service ID"); + SDL_LOG_ERROR("GASD response received with an unpublished service ID"); SendErrorResponse( correlation_id(), hmi_apis::FunctionID::AppService_GetAppServiceData, @@ -202,8 +202,7 @@ bool ASGetAppServiceDataRequestFromHMI::ValidateResponse( service_type, &service_type_value)) { auto app = application_manager_.application(service->connection_key); if (!app) { - LOG4CXX_ERROR(logger_, - "Failed to find service provider for GASD response"); + SDL_LOG_ERROR("Failed to find service provider for GASD response"); SendErrorResponse( correlation_id(), hmi_apis::FunctionID::AppService_GetAppServiceData, @@ -277,7 +276,7 @@ void ASGetAppServiceDataRequestFromHMI::on_event( } void ASGetAppServiceDataRequestFromHMI::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendErrorResponse(correlation_id(), hmi_apis::FunctionID::AppService_GetAppServiceData, hmi_apis::Common_Result::GENERIC_ERROR, diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc index 635cd7319a..e0b99105d7 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc @@ -38,6 +38,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASGetAppServiceDataRequestToHMI::ASGetAppServiceDataRequestToHMI( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ ASGetAppServiceDataRequestToHMI::ASGetAppServiceDataRequestToHMI( ASGetAppServiceDataRequestToHMI::~ASGetAppServiceDataRequestToHMI() {} void ASGetAppServiceDataRequestToHMI::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc index c0b1b274fb..853c382f46 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc @@ -41,6 +41,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASGetAppServiceDataResponseFromHMI::ASGetAppServiceDataResponseFromHMI( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ ASGetAppServiceDataResponseFromHMI::ASGetAppServiceDataResponseFromHMI( ASGetAppServiceDataResponseFromHMI::~ASGetAppServiceDataResponseFromHMI() {} void ASGetAppServiceDataResponseFromHMI::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::AppService_GetAppServiceData); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc index b489ec4765..6c53feb68f 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc @@ -38,6 +38,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASGetAppServiceDataResponseToHMI::ASGetAppServiceDataResponseToHMI( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ ASGetAppServiceDataResponseToHMI::ASGetAppServiceDataResponseToHMI( ASGetAppServiceDataResponseToHMI::~ASGetAppServiceDataResponseToHMI() {} void ASGetAppServiceDataResponseToHMI::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToHMI(message_); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc index fa704c1995..ac3666bf2e 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc @@ -38,6 +38,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASGetAppServiceRecordsRequest::ASGetAppServiceRecordsRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ ASGetAppServiceRecordsRequest::ASGetAppServiceRecordsRequest( ASGetAppServiceRecordsRequest::~ASGetAppServiceRecordsRequest() {} void ASGetAppServiceRecordsRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::string type; if ((*message_)[strings::msg_params].keyExists(strings::service_type)) { type = (*message_)[strings::msg_params][strings::service_type].asString(); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_response.cc index 0479aa8d31..f5f45d23f1 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_response.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_response.cc @@ -36,6 +36,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASGetAppServiceRecordsResponse::ASGetAppServiceRecordsResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ ASGetAppServiceRecordsResponse::ASGetAppServiceRecordsResponse( ASGetAppServiceRecordsResponse::~ASGetAppServiceRecordsResponse() {} void ASGetAppServiceRecordsResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToHMI(message_); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc index 6499b08c28..f5a1aac05c 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc @@ -39,6 +39,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASPerformAppServiceInteractionRequestFromHMI:: ASPerformAppServiceInteractionRequestFromHMI( const application_manager::commands::MessageSharedPtr& message, @@ -56,7 +58,7 @@ ASPerformAppServiceInteractionRequestFromHMI:: ~ASPerformAppServiceInteractionRequestFromHMI() {} void ASPerformAppServiceInteractionRequestFromHMI::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; std::string hmi_origin_id = @@ -148,7 +150,7 @@ void ASPerformAppServiceInteractionRequestFromHMI::on_event( } void ASPerformAppServiceInteractionRequestFromHMI::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject response_params; response_params[strings::info] = "The provider did not respond to the request"; diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_to_hmi.cc index 22876328de..a0f5d69ed8 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_to_hmi.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_to_hmi.cc @@ -36,6 +36,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASPerformAppServiceInteractionRequestToHMI:: ASPerformAppServiceInteractionRequestToHMI( const application_manager::commands::MessageSharedPtr& message, @@ -53,7 +55,7 @@ ASPerformAppServiceInteractionRequestToHMI:: ~ASPerformAppServiceInteractionRequestToHMI() {} void ASPerformAppServiceInteractionRequestToHMI::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_from_hmi.cc index a2ffa65a73..c8608588c0 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_from_hmi.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_from_hmi.cc @@ -36,6 +36,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASPerformAppServiceInteractionResponseFromHMI:: ASPerformAppServiceInteractionResponseFromHMI( const application_manager::commands::MessageSharedPtr& message, @@ -53,7 +55,7 @@ ASPerformAppServiceInteractionResponseFromHMI:: ~ASPerformAppServiceInteractionResponseFromHMI() {} void ASPerformAppServiceInteractionResponseFromHMI::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::AppService_PerformAppServiceInteraction); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_to_hmi.cc index 5ddef55c2a..45d6a15999 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_to_hmi.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_to_hmi.cc @@ -36,6 +36,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASPerformAppServiceInteractionResponseToHMI:: ASPerformAppServiceInteractionResponseToHMI( const application_manager::commands::MessageSharedPtr& message, @@ -53,7 +55,7 @@ ASPerformAppServiceInteractionResponseToHMI:: ~ASPerformAppServiceInteractionResponseToHMI() {} void ASPerformAppServiceInteractionResponseToHMI::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToHMI(message_); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc index 35a3e8a6b3..156530f9e3 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc @@ -39,6 +39,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASPublishAppServiceRequest::ASPublishAppServiceRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,8 +56,8 @@ ASPublishAppServiceRequest::ASPublishAppServiceRequest( ASPublishAppServiceRequest::~ASPublishAppServiceRequest() {} void ASPublishAppServiceRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Received a PublishAppService request from HMI"); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Received a PublishAppService request from HMI"); smart_objects::SmartObject response_params = smart_objects::SmartObject(smart_objects::SmartType_Map); smart_objects::SmartObject manifest = diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc index c143315b8c..49d3968cef 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc @@ -37,6 +37,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASPublishAppServiceResponse::ASPublishAppServiceResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ ASPublishAppServiceResponse::ASPublishAppServiceResponse( ASPublishAppServiceResponse::~ASPublishAppServiceResponse() {} void ASPublishAppServiceResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToHMI(message_); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_request.cc index 30905b5fa2..f29b974862 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_request.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_request.cc @@ -40,6 +40,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASUnpublishAppServiceRequest::ASUnpublishAppServiceRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ ASUnpublishAppServiceRequest::ASUnpublishAppServiceRequest( ASUnpublishAppServiceRequest::~ASUnpublishAppServiceRequest() {} void ASUnpublishAppServiceRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::string service_id = (*message_)[strings::msg_params][strings::service_id].asString(); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_response.cc index 0c8b479da8..6b665fafd0 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_response.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_unpublish_app_service_response.cc @@ -39,6 +39,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ASUnpublishAppServiceResponse::ASUnpublishAppServiceResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ ASUnpublishAppServiceResponse::ASUnpublishAppServiceResponse( ASUnpublishAppServiceResponse::~ASUnpublishAppServiceResponse() {} void ASUnpublishAppServiceResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToHMI(message_); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc index db1716ecb8..0f1fbcf1ce 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc @@ -41,6 +41,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnASAppServiceDataNotification::OnASAppServiceDataNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -156,8 +158,7 @@ void OnASAppServiceDataNotification::GetNavigationImagePaths( bool OnASAppServiceDataNotification::ValidateParams( smart_objects::SmartObject& message_params) { if (!message_params.keyExists(strings::service_data)) { - LOG4CXX_DEBUG(logger_, - "OASD notification received without any service data"); + SDL_LOG_DEBUG("OASD notification received without any service data"); return false; } smart_objects::SmartObject& service_data = @@ -168,8 +169,7 @@ bool OnASAppServiceDataNotification::ValidateParams( auto service = application_manager_.GetAppServiceManager().FindServiceByID(service_id); if (!service) { - LOG4CXX_ERROR(logger_, - "OASD notification received with an unpublished service ID"); + SDL_LOG_ERROR("OASD notification received with an unpublished service ID"); return false; } @@ -179,8 +179,7 @@ bool OnASAppServiceDataNotification::ValidateParams( service_type, &service_type_value)) { auto app = application_manager_.application(service->connection_key); if (!app) { - LOG4CXX_ERROR(logger_, - "Failed to find service provider for OASD message"); + SDL_LOG_ERROR("Failed to find service provider for OASD message"); return false; } @@ -204,8 +203,8 @@ bool OnASAppServiceDataNotification::ValidateParams( } void OnASAppServiceDataNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Sending AS data to HMI"); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Sending AS data to HMI"); if (ValidateParams((*message_)[strings::msg_params])) { SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc index 1c73fc73f4..5483873c3c 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc @@ -38,6 +38,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnASAppServiceDataNotificationFromHMI::OnASAppServiceDataNotificationFromHMI( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,8 +56,8 @@ OnASAppServiceDataNotificationFromHMI:: ~OnASAppServiceDataNotificationFromHMI() {} void OnASAppServiceDataNotificationFromHMI::Run() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Received an OnAppServiceData from HMI"); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Received an OnAppServiceData from HMI"); std::string service_id = (*message_)[strings::msg_params][strings::service_data] @@ -64,14 +66,14 @@ void OnASAppServiceDataNotificationFromHMI::Run() { AppService* service = application_manager_.GetAppServiceManager().FindServiceByID(service_id); if (!service) { - LOG4CXX_ERROR( - logger_, "No published services exist with service ID: " << service_id); + SDL_LOG_ERROR( + "No published services exist with service ID: " << service_id); return; } else if (service->mobile_service) { - LOG4CXX_ERROR(logger_, "Service was not published by the HMI"); + SDL_LOG_ERROR("Service was not published by the HMI"); return; } else if (!service->record[strings::service_active].asBool()) { - LOG4CXX_ERROR(logger_, "Service is not active"); + SDL_LOG_ERROR("Service is not active"); return; } @@ -83,11 +85,9 @@ void OnASAppServiceDataNotificationFromHMI::Run() { service->record[strings::service_manifest][strings::service_type] .asString(); if (published_service_type != service_type) { - LOG4CXX_ERROR(logger_, - "Service type mismatch, expected " - << service_type - << ", but service was published with type " - << published_service_type); + SDL_LOG_ERROR("Service type mismatch, expected " + << service_type << ", but service was published with type " + << published_service_type); return; } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc index e3bf40308d..719856625d 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc @@ -42,6 +42,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetAppServiceDataRequest::GetAppServiceDataRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,7 +59,7 @@ GetAppServiceDataRequest::GetAppServiceDataRequest( GetAppServiceDataRequest::~GetAppServiceDataRequest() {} void GetAppServiceDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendProviderRequest(mobile_apis::FunctionID::GetAppServiceDataID, hmi_apis::FunctionID::AppService_GetAppServiceData, diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc index 0af1a5436b..1a8912518a 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc @@ -38,6 +38,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetAppServiceDataRequestToMobile::GetAppServiceDataRequestToMobile( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ GetAppServiceDataRequestToMobile::GetAppServiceDataRequestToMobile( GetAppServiceDataRequestToMobile::~GetAppServiceDataRequestToMobile() {} void GetAppServiceDataRequestToMobile::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc index 32ad8e014d..9c0b46c209 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc @@ -38,6 +38,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetAppServiceDataResponse::GetAppServiceDataResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ GetAppServiceDataResponse::GetAppServiceDataResponse( GetAppServiceDataResponse::~GetAppServiceDataResponse() {} void GetAppServiceDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc index 90fca04eb2..04b969502b 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc @@ -40,6 +40,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetAppServiceDataResponseFromMobile::GetAppServiceDataResponseFromMobile( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ GetAppServiceDataResponseFromMobile::GetAppServiceDataResponseFromMobile( GetAppServiceDataResponseFromMobile::~GetAppServiceDataResponseFromMobile() {} void GetAppServiceDataResponseFromMobile::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::MobileEvent event(mobile_apis::FunctionID::GetAppServiceDataID); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc index 1ffe99462d..674578946a 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc @@ -46,6 +46,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAppServiceDataNotification::OnAppServiceDataNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -61,8 +63,8 @@ OnAppServiceDataNotification::OnAppServiceDataNotification( OnAppServiceDataNotification::~OnAppServiceDataNotification() {} void OnAppServiceDataNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Sending OnAppServiceData to consumer"); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Sending OnAppServiceData to consumer"); std::string service_id = (*message_)[strings::msg_params][strings::service_data] @@ -72,15 +74,15 @@ void OnAppServiceDataNotification::Run() { application_manager_.GetAppServiceManager().FindServiceByID(service_id); if (!service) { - LOG4CXX_ERROR(logger_, "Service sending OnAppServiceData is not published"); + SDL_LOG_ERROR("Service sending OnAppServiceData is not published"); return; } else if (!service ->record[strings::service_manifest] [strings::allow_app_consumers] .asBool()) { - LOG4CXX_ERROR(logger_, - "Service does not allow for app consumers, skipping mobile " - "OnAppServiceData notification"); + SDL_LOG_ERROR( + "Service does not allow for app consumers, skipping mobile " + "OnAppServiceData notification"); return; } @@ -93,7 +95,7 @@ void OnAppServiceDataNotification::Run() { [service_type](const ApplicationSharedPtr app) { DCHECK_OR_RETURN(app, false); auto& ext = AppServiceAppExtension::ExtractASExtension(*app); - LOG4CXX_DEBUG(logger_, "Check subscription for type: " << service_type); + SDL_LOG_DEBUG("Check subscription for type: " << service_type); return ext.IsSubscribedToAppService(service_type); }; @@ -107,12 +109,11 @@ void OnAppServiceDataNotification::Run() { for (; applications.end() != app_it; ++app_it) { const ApplicationSharedPtr app = *app_it; if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); continue; } - LOG4CXX_DEBUG(logger_, - "Sending OnAppServiceDataNotification to mobile connection: " - << app->app_id()); + SDL_LOG_DEBUG("Sending OnAppServiceDataNotification to mobile connection: " + << app->app_id()); (*message_)[app_mngr::strings::params][app_mngr::strings::connection_key] = app->app_id(); SendNotification(); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc index 5caacc9801..4c1caebd36 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc @@ -41,6 +41,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAppServiceDataNotificationFromMobile::OnAppServiceDataNotificationFromMobile( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,8 +59,8 @@ OnAppServiceDataNotificationFromMobile:: ~OnAppServiceDataNotificationFromMobile() {} void OnAppServiceDataNotificationFromMobile::Run() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Received an OnAppServiceData"); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Received an OnAppServiceData"); MessageHelper::PrintSmartObject(*message_); uint32_t app_connection_key = connection_key(); @@ -74,9 +76,9 @@ void OnAppServiceDataNotificationFromMobile::Run() { app->policy_app_id(), std::string(), service_type, NULL); if (!result) { - LOG4CXX_DEBUG(logger_, - "Incorrect service type received in " - "OnAppServiceDataNotificationFromMobile"); + SDL_LOG_DEBUG( + "Incorrect service type received in " + "OnAppServiceDataNotificationFromMobile"); return; } @@ -87,15 +89,15 @@ void OnAppServiceDataNotificationFromMobile::Run() { AppService* service = application_manager_.GetAppServiceManager().FindServiceByID(service_id); if (!service) { - LOG4CXX_ERROR( - logger_, "No published services exist with service ID: " << service_id); + SDL_LOG_ERROR( + "No published services exist with service ID: " << service_id); return; } else if (!service->mobile_service || service->connection_key != app_connection_key) { - LOG4CXX_ERROR(logger_, "Service was not published by this application"); + SDL_LOG_ERROR("Service was not published by this application"); return; } else if (!service->record[strings::service_active].asBool()) { - LOG4CXX_ERROR(logger_, "Service is not active"); + SDL_LOG_ERROR("Service is not active"); return; } @@ -103,11 +105,9 @@ void OnAppServiceDataNotificationFromMobile::Run() { service->record[strings::service_manifest][strings::service_type] .asString(); if (published_service_type != service_type) { - LOG4CXX_ERROR(logger_, - "Service type mismatch, expected " - << service_type - << ", but service was published with type " - << published_service_type); + SDL_LOG_ERROR("Service type mismatch, expected " + << service_type << ", but service was published with type " + << published_service_type); return; } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc index 63b6e47d8e..c303e6d99f 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc @@ -41,6 +41,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + PerformAppServiceInteractionRequest::PerformAppServiceInteractionRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ PerformAppServiceInteractionRequest::PerformAppServiceInteractionRequest( PerformAppServiceInteractionRequest::~PerformAppServiceInteractionRequest() {} void PerformAppServiceInteractionRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto app = application_manager_.application(connection_key()); if (!app) { @@ -122,7 +124,7 @@ void PerformAppServiceInteractionRequest::Run() { void PerformAppServiceInteractionRequest::on_event( const event_engine::Event& event) { - LOG4CXX_DEBUG(logger_, "HMI PerformAppServiceInteraction on_event"); + SDL_LOG_DEBUG("HMI PerformAppServiceInteraction on_event"); const smart_objects::SmartObject& event_message = event.smart_object(); auto msg_params = event_message[strings::msg_params]; @@ -169,7 +171,7 @@ void PerformAppServiceInteractionRequest::on_event( void PerformAppServiceInteractionRequest::on_event( const event_engine::MobileEvent& event) { - LOG4CXX_DEBUG(logger_, "Mobile PerformAppServiceInteraction on_event"); + SDL_LOG_DEBUG("Mobile PerformAppServiceInteraction on_event"); const smart_objects::SmartObject& event_message = event.smart_object(); auto msg_params = event_message[strings::msg_params]; diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc index 2a7b644cb3..4997f63232 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc @@ -37,6 +37,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + PerformAppServiceInteractionRequestToMobile:: PerformAppServiceInteractionRequestToMobile( const application_manager::commands::MessageSharedPtr& message, @@ -54,7 +56,7 @@ PerformAppServiceInteractionRequestToMobile:: ~PerformAppServiceInteractionRequestToMobile() {} void PerformAppServiceInteractionRequestToMobile::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc index 5e84f42c34..a5a81eb325 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc @@ -37,6 +37,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + PerformAppServiceInteractionResponse::PerformAppServiceInteractionResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ PerformAppServiceInteractionResponse::PerformAppServiceInteractionResponse( PerformAppServiceInteractionResponse::~PerformAppServiceInteractionResponse() {} void PerformAppServiceInteractionResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response_from_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response_from_mobile.cc index 9912df84ce..25ef530b8d 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response_from_mobile.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response_from_mobile.cc @@ -38,6 +38,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + PerformAppServiceInteractionResponseFromMobile:: PerformAppServiceInteractionResponseFromMobile( const application_manager::commands::MessageSharedPtr& message, @@ -55,7 +57,7 @@ PerformAppServiceInteractionResponseFromMobile:: ~PerformAppServiceInteractionResponseFromMobile() {} void PerformAppServiceInteractionResponseFromMobile::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::MobileEvent event( mobile_apis::FunctionID::PerformAppServiceInteractionID); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc index 53d1bf82fa..f2bc66520b 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc @@ -43,6 +43,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + PublishAppServiceRequest::PublishAppServiceRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -58,8 +60,8 @@ PublishAppServiceRequest::PublishAppServiceRequest( PublishAppServiceRequest::~PublishAppServiceRequest() {} void PublishAppServiceRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Received a PublishAppService " << connection_key()); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Received a PublishAppService " << connection_key()); MessageHelper::PrintSmartObject(*message_); smart_objects::SmartObject response_params = diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc index d1bfc6e154..53dff48f43 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc @@ -39,6 +39,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + PublishAppServiceResponse::PublishAppServiceResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ PublishAppServiceResponse::PublishAppServiceResponse( PublishAppServiceResponse::~PublishAppServiceResponse() {} void PublishAppServiceResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_request.cc index 2cb43bce07..200bae01d9 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_request.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_request.cc @@ -41,6 +41,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UnpublishAppServiceRequest::UnpublishAppServiceRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ UnpublishAppServiceRequest::UnpublishAppServiceRequest( UnpublishAppServiceRequest::~UnpublishAppServiceRequest() {} void UnpublishAppServiceRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::string service_id = (*message_)[strings::msg_params][strings::service_id].asString(); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_response.cc index 22450ecc4c..6b48c7f225 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_response.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/unpublish_app_service_response.cc @@ -39,6 +39,8 @@ namespace app_service_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UnpublishAppServiceResponse::UnpublishAppServiceResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UnpublishAppServiceResponse::UnpublishAppServiceResponse( UnpublishAppServiceResponse::~UnpublishAppServiceResponse() {} void UnpublishAppServiceResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h index e12bd88e58..51e0668930 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h @@ -42,6 +42,7 @@ #include "rc_rpc_plugin/rc_capabilities_manager.h" #include "rc_rpc_plugin/rc_consent_manager.h" #include "rc_rpc_plugin/resource_allocation_manager.h" +#include "utils/ilogger.h" namespace rc_rpc_plugin { namespace plugins = application_manager::plugin_manager; @@ -120,7 +121,8 @@ class RCRPCPlugin : public plugins::RPCPlugin { }; } // namespace rc_rpc_plugin -extern "C" application_manager::plugin_manager::RPCPlugin* Create(); +extern "C" application_manager::plugin_manager::RPCPlugin* Create( + logger::Logger* logger_instance); extern "C" void Delete(application_manager::plugin_manager::RPCPlugin* data); #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_RPC_PLUGIN_H_ diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc index 75faf5db8c..6fe3e31aa4 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc @@ -38,6 +38,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCButtonPressRequest::RCButtonPressRequest( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -50,7 +52,7 @@ RCButtonPressRequest::RCButtonPressRequest( RCButtonPressRequest::~RCButtonPressRequest() {} void RCButtonPressRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc index 5c1691ed7b..33610c5a4d 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc @@ -36,6 +36,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCButtonPressResponse::RCButtonPressResponse( const application_manager::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -47,7 +49,7 @@ RCButtonPressResponse::RCButtonPressResponse( params.policy_handler_) {} void RCButtonPressResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::event_engine::Event event( hmi_apis::FunctionID::Buttons_ButtonPress); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc index 774ee04677..a4d2d96772 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc @@ -36,6 +36,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCGetInteriorVehicleDataConsentRequest::RCGetInteriorVehicleDataConsentRequest( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -49,7 +51,7 @@ RCGetInteriorVehicleDataConsentRequest:: ~RCGetInteriorVehicleDataConsentRequest() {} void RCGetInteriorVehicleDataConsentRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc index 3244857656..1ae8158602 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc @@ -36,6 +36,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCGetInteriorVehicleDataConsentResponse:: RCGetInteriorVehicleDataConsentResponse( const application_manager::commands::MessageSharedPtr& message, @@ -48,7 +50,7 @@ RCGetInteriorVehicleDataConsentResponse:: params.policy_handler_) {} void RCGetInteriorVehicleDataConsentResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::event_engine::Event event( hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc index c7baf75e27..ffe124f3bd 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc @@ -36,6 +36,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCGetInteriorVehicleDataRequest::RCGetInteriorVehicleDataRequest( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -48,7 +50,7 @@ RCGetInteriorVehicleDataRequest::RCGetInteriorVehicleDataRequest( RCGetInteriorVehicleDataRequest::~RCGetInteriorVehicleDataRequest() {} void RCGetInteriorVehicleDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc index a366aa65fa..7e935621d4 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc @@ -37,6 +37,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCGetInteriorVehicleDataResponse::RCGetInteriorVehicleDataResponse( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -48,7 +50,7 @@ RCGetInteriorVehicleDataResponse::RCGetInteriorVehicleDataResponse( params.policy_handler_) {} void RCGetInteriorVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::event_engine::Event event( hmi_apis::FunctionID::RC_GetInteriorVehicleData); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc index c6cf1b0d5a..68587e0861 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc @@ -37,6 +37,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCOnInteriorVehicleDataNotification::RCOnInteriorVehicleDataNotification( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -50,7 +52,7 @@ RCOnInteriorVehicleDataNotification::RCOnInteriorVehicleDataNotification( RCOnInteriorVehicleDataNotification::~RCOnInteriorVehicleDataNotification() {} void RCOnInteriorVehicleDataNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[app_mngr::strings::params][app_mngr::strings::function_id] = static_cast<int>(mobile_apis::FunctionID::eType::OnInteriorVehicleDataID); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc index 45b0d13582..b7a343a907 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc @@ -47,7 +47,7 @@ std::map<std::string, hmi_apis::Common_RCAccessMode::eType> access_modes{ {enums_value::kAskDriver, hmi_apis::Common_RCAccessMode::ASK_DRIVER}}; } -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") +SDL_CREATE_LOG_VARIABLE("Commands") RCOnRemoteControlSettingsNotification::RCOnRemoteControlSettingsNotification( const app_mngr::commands::MessageSharedPtr& message, @@ -89,18 +89,17 @@ std::string AccessModeToString( } void RCOnRemoteControlSettingsNotification::DisallowRCFunctionality() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); interior_data_manager_.OnDisablingRC(); } void RCOnRemoteControlSettingsNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!(*message_)[app_mngr::strings::msg_params].keyExists( message_params::kAllowed)) { - LOG4CXX_DEBUG(logger_, - "Notification is ignored due to \"allow\" parameter absense"); - LOG4CXX_DEBUG(logger_, "RC Functionality remains unchanged"); + SDL_LOG_DEBUG("Notification is ignored due to \"allow\" parameter absense"); + SDL_LOG_DEBUG("RC Functionality remains unchanged"); return; } @@ -110,7 +109,7 @@ void RCOnRemoteControlSettingsNotification::Run() { if (is_allowed) { hmi_apis::Common_RCAccessMode::eType access_mode = hmi_apis::Common_RCAccessMode::INVALID_ENUM; - LOG4CXX_DEBUG(logger_, "Allowing RC Functionality"); + SDL_LOG_DEBUG("Allowing RC Functionality"); resource_allocation_manager_.set_rc_enabled(true); if ((*message_)[app_mngr::strings::msg_params].keyExists( message_params::kAccessMode)) { @@ -118,18 +117,16 @@ void RCOnRemoteControlSettingsNotification::Run() { (*message_)[app_mngr::strings::msg_params] [message_params::kAccessMode] .asUInt()); - LOG4CXX_DEBUG( - logger_, + SDL_LOG_DEBUG( "Setting up access mode : " << AccessModeToString(access_mode)); } else { access_mode = resource_allocation_manager_.GetAccessMode(); - LOG4CXX_DEBUG(logger_, - "No access mode received. Using last known: " - << AccessModeToString(access_mode)); + SDL_LOG_DEBUG("No access mode received. Using last known: " + << AccessModeToString(access_mode)); } resource_allocation_manager_.SetAccessMode(access_mode); } else { - LOG4CXX_DEBUG(logger_, "Disallowing RC Functionality"); + SDL_LOG_DEBUG("Disallowing RC Functionality"); DisallowRCFunctionality(); resource_allocation_manager_.ResetAllAllocations(); resource_allocation_manager_.set_rc_enabled(false); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_global_properties_request.cc index 2f203afc2d..f0ff1afbb3 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_global_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_global_properties_request.cc @@ -37,6 +37,8 @@ namespace app_mngr = application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCSetGlobalPropertiesRequest::RCSetGlobalPropertiesRequest( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -47,7 +49,7 @@ RCSetGlobalPropertiesRequest::RCSetGlobalPropertiesRequest( params.policy_handler_) {} void RCSetGlobalPropertiesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_global_properties_response.cc index c31314ec21..3779cfc198 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_global_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_global_properties_response.cc @@ -35,6 +35,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCSetGlobalPropertiesResponse::RCSetGlobalPropertiesResponse( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -46,7 +48,7 @@ RCSetGlobalPropertiesResponse::RCSetGlobalPropertiesResponse( params.policy_handler_) {} void RCSetGlobalPropertiesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::event_engine::Event event( hmi_apis::FunctionID::RC_SetGlobalProperties); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc index f0d5ecc177..618f200d18 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc @@ -36,6 +36,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCSetInteriorVehicleDataRequest::RCSetInteriorVehicleDataRequest( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -47,7 +49,7 @@ RCSetInteriorVehicleDataRequest::RCSetInteriorVehicleDataRequest( RCSetInteriorVehicleDataRequest::~RCSetInteriorVehicleDataRequest() {} void RCSetInteriorVehicleDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc index 56d924debe..94cf2837d8 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc @@ -36,6 +36,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCSetInteriorVehicleDataResponse::RCSetInteriorVehicleDataResponse( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -47,7 +49,7 @@ RCSetInteriorVehicleDataResponse::RCSetInteriorVehicleDataResponse( params.policy_handler_) {} void RCSetInteriorVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::event_engine::Event event( hmi_apis::FunctionID::RC_SetInteriorVehicleData); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc index 3adc48dfbf..9bf7977bdf 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc @@ -45,7 +45,7 @@ namespace commands { using namespace json_keys; using namespace message_params; -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") +SDL_CREATE_LOG_VARIABLE("Commands") ButtonPressRequest::ButtonPressRequest( const app_mngr::commands::MessageSharedPtr& message, @@ -78,7 +78,7 @@ const mobile_apis::ButtonName::eType ButtonPressRequest::GetButtonId() const { } void ButtonPressRequest::Execute() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const std::string module_type = ModuleType(); const bool button_name_matches_module_type = @@ -106,14 +106,13 @@ void ButtonPressRequest::Execute() { &(*message_)[app_mngr::strings::msg_params], true); } else if (!button_name_matches_module_type) { - LOG4CXX_WARN(logger_, "Request module type and button name mismatch!"); + SDL_LOG_WARN("Request module type and button name mismatch!"); SetResourceState(module_type, ResourceState::FREE); SendResponse(false, mobile_apis::Result::INVALID_DATA, "Request module type and button name mismatch!"); } else { - LOG4CXX_WARN(logger_, - "Requested button or module does not exist in capabilities!"); + SDL_LOG_WARN("Requested button or module does not exist in capabilities!"); SetResourceState(module_type, ResourceState::FREE); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE, @@ -123,7 +122,7 @@ void ButtonPressRequest::Execute() { AcquireResult::eType ButtonPressRequest::AcquireResource( const app_mngr::commands::MessageSharedPtr& message) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const std::string module_type = ModuleType(); app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); @@ -134,13 +133,13 @@ AcquireResult::eType ButtonPressRequest::AcquireResource( bool ButtonPressRequest::IsResourceFree(const std::string& module_type, const std::string& module_id) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); return resource_allocation_manager_.IsResourceFree(module_type, module_id); } void ButtonPressRequest::SetResourceState(const std::string& module_type, const ResourceState::eType state) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); @@ -149,7 +148,7 @@ void ButtonPressRequest::SetResourceState(const std::string& module_type, } void ButtonPressRequest::on_event(const app_mngr::event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); RCCommandRequest::on_event(event); if (hmi_apis::FunctionID::Buttons_ButtonPress != event.id()) { @@ -180,7 +179,7 @@ void ButtonPressRequest::on_event(const app_mngr::event_engine::Event& event) { auto 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; } @@ -221,7 +220,7 @@ std::string ButtonPressRequest::ModuleType() const { } std::string ButtonPressRequest::ModuleId() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto msg_params = (*message_)[app_mngr::strings::msg_params]; if (msg_params.keyExists(message_params::kModuleId)) { return msg_params[message_params::kModuleId].asString(); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc index 491b0363c9..7f9ccf5839 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc @@ -36,6 +36,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ButtonPressResponse::ButtonPressResponse( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -48,7 +50,7 @@ ButtonPressResponse::ButtonPressResponse( ButtonPressResponse::~ButtonPressResponse() {} void ButtonPressResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); application_manager_.GetRPCService().SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc index fd661afd5f..a13a7f2a9e 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_request.cc @@ -45,13 +45,15 @@ namespace rc_rpc_plugin { namespace app_mngr = application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetInteriorVehicleDataConsentRequest::GetInteriorVehicleDataConsentRequest( const application_manager::commands::MessageSharedPtr& message, const RCCommandParams& params) : RCCommandRequest(message, params) {} void GetInteriorVehicleDataConsentRequest::Execute() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto& msg_params = (*message_)[app_mngr::strings::msg_params]; @@ -65,9 +67,9 @@ void GetInteriorVehicleDataConsentRequest::Execute() { } if (msg_params[message_params::kModuleIds].empty()) { - LOG4CXX_DEBUG(logger_, - "ModuleIds collection is empty. Will be add default " - "module_id from capabilities"); + SDL_LOG_DEBUG( + "ModuleIds collection is empty. Will be add default " + "module_id from capabilities"); const auto module_id = rc_capabilities_manager_.GetDefaultModuleIdFromCapabilities( @@ -81,8 +83,7 @@ void GetInteriorVehicleDataConsentRequest::Execute() { *(msg_params[message_params::kModuleIds].asArray())) { const ModuleUid module(module_type, module_id.asString()); if (!rc_capabilities_manager_.CheckIfModuleExistsInCapabilities(module)) { - LOG4CXX_WARN(logger_, - "Accessing not supported module: " << module_type << " " + SDL_LOG_WARN("Accessing not supported module: " << module_type << " " << module_id.asString()); SetResourceState(module_type, ResourceState::FREE); SendResponse(false, @@ -94,8 +95,7 @@ void GetInteriorVehicleDataConsentRequest::Execute() { smart_objects::SmartObject response_params; if (GetCalculatedVehicleDataConsent(response_params)) { - LOG4CXX_DEBUG( - logger_, + SDL_LOG_DEBUG( "No need to send request to HMI. Sending cached consents to mobile"); SendResponse(true, mobile_apis::Result::SUCCESS, nullptr, &response_params); return; @@ -107,8 +107,8 @@ void GetInteriorVehicleDataConsentRequest::Execute() { hmi_request_consents_ = smart_objects::SmartObject(response_params[message_params::kAllowed]); - LOG4CXX_DEBUG( - logger_, "Filtering out module ids with successfully calculated consent"); + SDL_LOG_DEBUG( + "Filtering out module ids with successfully calculated consent"); smart_objects::SmartObject hmi_msg_params(msg_params); auto module_ids_for_consent = @@ -126,9 +126,9 @@ void GetInteriorVehicleDataConsentRequest::Execute() { } } - LOG4CXX_DEBUG(logger_, - "Forwarding request to HMI with moduleIds for modules with " - "unknown consent"); + SDL_LOG_DEBUG( + "Forwarding request to HMI with moduleIds for modules with " + "unknown consent"); SendHMIRequest(hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent, (&hmi_msg_params), true); @@ -136,10 +136,10 @@ void GetInteriorVehicleDataConsentRequest::Execute() { void GetInteriorVehicleDataConsentRequest::on_event( const app_mngr::event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (event.id() != hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent) { - LOG4CXX_ERROR(logger_, "Received wrong event. FunctionID: " << event.id()); + SDL_LOG_ERROR("Received wrong event. FunctionID: " << event.id()); return; } @@ -169,7 +169,7 @@ void GetInteriorVehicleDataConsentRequest::on_event( .empty()) { std::string info_out = "Collection of consents is absent in HMI response or empty"; - LOG4CXX_ERROR(logger_, info_out); + SDL_LOG_ERROR(info_out); SendResponse(false, mobile_apis::Result::GENERIC_ERROR, info_out.c_str()); return; } @@ -194,13 +194,12 @@ void GetInteriorVehicleDataConsentRequest::on_event( "HMI response has incorrect number of consents expected: " + std::to_string(number_of_expected_response_consents) + ", actual: " + std::to_string(response_consents->size()); - LOG4CXX_ERROR(logger_, info_out); + SDL_LOG_ERROR(info_out); SendResponse(false, mobile_apis::Result::GENERIC_ERROR, info_out.c_str()); return; } - LOG4CXX_DEBUG(logger_, - "Adding back filtered out module ids for response to mobile"); + SDL_LOG_DEBUG("Adding back filtered out module ids for response to mobile"); uint32_t response_consents_counter = 0; for (auto& consent : *(hmi_request_consents_.asArray())) { // Only modify consent for moduleIds allowed by location constraints @@ -221,7 +220,7 @@ void GetInteriorVehicleDataConsentRequest::on_event( response_info, hmi_response[app_mngr::strings::msg_params]); if (!result_of_saving) { - LOG4CXX_DEBUG(logger_, "Consent saving failed"); + SDL_LOG_DEBUG("Consent saving failed"); SendResponse( false, mobile_apis::Result::GENERIC_ERROR, response_info.c_str()); return; @@ -255,7 +254,7 @@ GetInteriorVehicleDataConsentRequest::~GetInteriorVehicleDataConsentRequest() {} bool GetInteriorVehicleDataConsentRequest::IsUserLocationValid( const ModuleUid& module_uid) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!rc_capabilities_manager_.IsSeatLocationCapabilityProvided()) { return true; @@ -278,7 +277,7 @@ rc_rpc_types::ModuleConsent GetInteriorVehicleDataConsentRequest::GetModuleConsentByAccessMode( const ModuleUid& module_uid, const hmi_apis::Common_RCAccessMode::eType access_mode) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto get_auto_allow_consent = [](const ModuleUid& module_uid) { return rc_rpc_types::ModuleConsent::CONSENTED; @@ -328,31 +327,26 @@ GetInteriorVehicleDataConsentRequest::GetModuleConsentByAccessMode( switch (access_mode) { case hmi_apis::Common_RCAccessMode::AUTO_ALLOW: { - LOG4CXX_DEBUG(logger_, - "Calculating consent for module(" - << module_uid.first << ", " << module_uid.second - << ") in accessMode: AUTO_ALLOW"); + SDL_LOG_DEBUG("Calculating consent for module(" + << module_uid.first << ", " << module_uid.second + << ") in accessMode: AUTO_ALLOW"); return get_auto_allow_consent(module_uid); } case hmi_apis::Common_RCAccessMode::AUTO_DENY: { - LOG4CXX_DEBUG(logger_, - "Calculating consent for module(" - << module_uid.first << ", " << module_uid.second - << ") in accessMode: AUTO_DENY"); + SDL_LOG_DEBUG("Calculating consent for module(" + << module_uid.first << ", " << module_uid.second + << ") in accessMode: AUTO_DENY"); return get_auto_deny_consent(module_uid); } case hmi_apis::Common_RCAccessMode::ASK_DRIVER: { - LOG4CXX_DEBUG(logger_, - "Calculating consent for module(" - << module_uid.first << ", " << module_uid.second - << ") in accessMode: ASK_DRIVER"); + SDL_LOG_DEBUG("Calculating consent for module(" + << module_uid.first << ", " << module_uid.second + << ") in accessMode: ASK_DRIVER"); return get_ask_driver_consent(module_uid); } default: { - LOG4CXX_DEBUG(logger_, - "Unknown accessMode specified. Denying consent for module(" - << module_uid.first << ", " << module_uid.second - << ")"); + SDL_LOG_DEBUG("Unknown accessMode specified. Denying consent for module(" + << module_uid.first << ", " << module_uid.second << ")"); return rc_rpc_types::ModuleConsent::NOT_CONSENTED; } } @@ -360,7 +354,7 @@ GetInteriorVehicleDataConsentRequest::GetModuleConsentByAccessMode( bool GetInteriorVehicleDataConsentRequest::GetCalculatedVehicleDataConsent( smart_objects::SmartObject& out_response) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); out_response = smart_objects::SmartObject(smart_objects::SmartType::SmartType_Map); @@ -391,10 +385,9 @@ bool GetInteriorVehicleDataConsentRequest::GetCalculatedVehicleDataConsent( const ModuleUid module_uid(module_type, module_id.asString()); // Check if the user_location is covered by the module's serviceArea if (!IsUserLocationValid(module_uid)) { - LOG4CXX_DEBUG(logger_, - "User is outside the serviceArea for module(" - << module_uid.first << ", " << module_uid.second - << "). Denying consent"); + SDL_LOG_DEBUG("User is outside the serviceArea for module(" + << module_uid.first << ", " << module_uid.second + << "). Denying consent"); modules_consent_array->push_back(smart_objects::SmartObject(false)); continue; } @@ -404,10 +397,8 @@ bool GetInteriorVehicleDataConsentRequest::GetCalculatedVehicleDataConsent( const bool is_multiple_access_allowed = rc_capabilities_manager_.IsMultipleAccessAllowed(module_uid); if (!is_multiple_access_allowed) { - LOG4CXX_DEBUG(logger_, - "multipleAccess disallowed for module(" - << module_uid.first << ", " << module_uid.second - << ")"); + SDL_LOG_DEBUG("multipleAccess disallowed for module(" + << module_uid.first << ", " << module_uid.second << ")"); module_consent = get_disallowed_multiple_access_consent(module_uid); modules_consent_array->push_back(smart_objects::SmartObject( module_consent == rc_rpc_types::ModuleConsent::CONSENTED)); @@ -418,10 +409,9 @@ bool GetInteriorVehicleDataConsentRequest::GetCalculatedVehicleDataConsent( module_consent = GetModuleConsentByAccessMode(module_uid, access_mode); if (module_consent == rc_rpc_types::ModuleConsent::NOT_EXISTS) { - LOG4CXX_DEBUG(logger_, - "Unable to calculate consent for module(" - << module_uid.first << ", " << module_uid.second - << "), should send moduleId to HMI for consent"); + SDL_LOG_DEBUG("Unable to calculate consent for module(" + << module_uid.first << ", " << module_uid.second + << "), should send moduleId to HMI for consent"); modules_consent_array->push_back(smart_objects::SmartObject()); can_handle_internally = false; continue; @@ -434,7 +424,7 @@ bool GetInteriorVehicleDataConsentRequest::GetCalculatedVehicleDataConsent( bool GetInteriorVehicleDataConsentRequest::SaveModuleIdConsents( std::string& info_out, const smart_objects::SmartObject& msg_params) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto& allowed = msg_params[message_params::kAllowed]; const auto& moduleIds = @@ -444,7 +434,7 @@ bool GetInteriorVehicleDataConsentRequest::SaveModuleIdConsents( info_out = "The received module_id collection from mobile and received consent " "collection from HMI are not equal by size."; - LOG4CXX_ERROR(logger_, info_out); + SDL_LOG_ERROR(info_out); return false; } std::string module_type = ModuleType(); @@ -456,8 +446,7 @@ bool GetInteriorVehicleDataConsentRequest::SaveModuleIdConsents( auto application = application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, - "Application with connection key:" << connection_key() + SDL_LOG_ERROR("Application with connection key:" << connection_key() << " isn't registered"); return false; } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_response.cc index 3e197fbdea..fe33e29e44 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_consent_response.cc @@ -35,6 +35,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetInteriorVehicleDataConsentResponse::GetInteriorVehicleDataConsentResponse( const application_manager::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -46,7 +48,7 @@ GetInteriorVehicleDataConsentResponse::GetInteriorVehicleDataConsentResponse( params.policy_handler_) {} void GetInteriorVehicleDataConsentResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); application_manager_.GetRPCService().SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc index e89b260dca..7d274870bc 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc @@ -44,7 +44,7 @@ namespace commands { using namespace json_keys; using namespace message_params; -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") +SDL_CREATE_LOG_VARIABLE("Commands") GetInteriorVehicleDataRequest::GetInteriorVehicleDataRequest( const app_mngr::commands::MessageSharedPtr& message, @@ -53,7 +53,7 @@ GetInteriorVehicleDataRequest::GetInteriorVehicleDataRequest( , excessive_subscription_occured_(false) {} bool GetInteriorVehicleDataRequest::ProcessCapabilities() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto rc_capability = hmi_capabilities_.rc_capability(); const std::string module_type = ModuleType(); @@ -61,9 +61,8 @@ bool GetInteriorVehicleDataRequest::ProcessCapabilities() { const ModuleUid module(module_type, module_id); if (rc_capability && !rc_capabilities_manager_.CheckIfModuleExistsInCapabilities(module)) { - LOG4CXX_WARN( - logger_, - "Accessing not supported module: " << module_type << " " << module_id); + SDL_LOG_WARN("Accessing not supported module: " << module_type << " " + << module_id); SetResourceState(ModuleType(), ResourceState::FREE); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE, @@ -100,7 +99,7 @@ void GetInteriorVehicleDataRequest::FilterDisabledModuleData( void GetInteriorVehicleDataRequest::ProcessResponseToMobileFromCache( app_mngr::ApplicationSharedPtr app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping(); const std::string module_type = ModuleType(); const std::string module_id = ModuleId(); @@ -118,9 +117,8 @@ void GetInteriorVehicleDataRequest::ProcessResponseToMobileFromCache( module_id; const auto& request_msg_params = (*message_)[app_mngr::strings::msg_params]; - LOG4CXX_DEBUG(logger_, - "kSubscribe exist" << request_msg_params.keyExists( - message_params::kSubscribe)); + SDL_LOG_DEBUG("kSubscribe exist" + << request_msg_params.keyExists(message_params::kSubscribe)); if (request_msg_params.keyExists(message_params::kSubscribe)) { response_msg_params[message_params::kIsSubscribed] = request_msg_params[message_params::kSubscribe].asBool(); @@ -140,7 +138,7 @@ void GetInteriorVehicleDataRequest::ProcessResponseToMobileFromCache( } bool GetInteriorVehicleDataRequest::CheckRateLimits() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const std::string module_type = ModuleType(); const std::string module_id = ModuleId(); const ModuleUid module(module_type, module_id); @@ -148,7 +146,7 @@ bool GetInteriorVehicleDataRequest::CheckRateLimits() { } bool GetInteriorVehicleDataRequest::AppShouldBeUnsubscribed() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto& msg_params = (*message_)[app_mngr::strings::msg_params]; if (msg_params.keyExists(message_params::kSubscribe)) { return !(msg_params[message_params::kSubscribe].asBool()); @@ -158,7 +156,7 @@ bool GetInteriorVehicleDataRequest::AppShouldBeUnsubscribed() { bool GetInteriorVehicleDataRequest::TheLastAppShouldBeUnsubscribed( app_mngr::ApplicationSharedPtr app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (AppShouldBeUnsubscribed()) { const std::string module_type = ModuleType(); const std::string module_id = ModuleId(); @@ -167,9 +165,8 @@ bool GetInteriorVehicleDataRequest::TheLastAppShouldBeUnsubscribed( RCHelpers::AppsSubscribedToModule(application_manager_, module); if (subscribed_to_module_type.size() == 1 && subscribed_to_module_type.front() == app) { - LOG4CXX_DEBUG(logger_, - "The last application unsubscribes from " - << module_type << " " << module_id); + SDL_LOG_DEBUG("The last application unsubscribes from " + << module_type << " " << module_id); return true; } } @@ -177,7 +174,7 @@ bool GetInteriorVehicleDataRequest::TheLastAppShouldBeUnsubscribed( } void GetInteriorVehicleDataRequest::Execute() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!ProcessCapabilities()) { return; @@ -199,7 +196,7 @@ void GetInteriorVehicleDataRequest::Execute() { RemoveExcessiveSubscription(); } if (!CheckRateLimits()) { - LOG4CXX_WARN(logger_, "GetInteriorVehicleData frequency is too high."); + SDL_LOG_WARN("GetInteriorVehicleData frequency is too high."); SendResponse(false, mobile_apis::Result::REJECTED); return; } @@ -216,7 +213,7 @@ void GetInteriorVehicleDataRequest::Execute() { void GetInteriorVehicleDataRequest::on_event( const app_mngr::event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); RCCommandRequest::on_event(event); if (hmi_apis::FunctionID::RC_GetInteriorVehicleData != event.id()) { @@ -244,10 +241,8 @@ void GetInteriorVehicleDataRequest::on_event( if (result) { if (!IsModuleIdProvided(hmi_response)) { - LOG4CXX_WARN(logger_, - "conditional mandatory parameter " - << message_params::kModuleId - << " missed in hmi response"); + SDL_LOG_WARN("conditional mandatory parameter " + << message_params::kModuleId << " missed in hmi response"); result = false; result_code = mobile_apis::Result::GENERIC_ERROR; } @@ -288,7 +283,7 @@ GetInteriorVehicleDataRequest::~GetInteriorVehicleDataRequest() {} void GetInteriorVehicleDataRequest::ProccessSubscription( const ns_smart_device_link::ns_smart_objects::SmartObject& hmi_response) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const bool is_subscribe_present_in_request = (*message_)[app_mngr::strings::msg_params].keyExists( @@ -332,10 +327,8 @@ void GetInteriorVehicleDataRequest::ProccessSubscription( } if (is_subscribe_present_in_request && !isSubscribed_present_in_response) { - LOG4CXX_WARN(logger_, - "conditional mandatory parameter " - << message_params::kIsSubscribed - << " missed in hmi response"); + SDL_LOG_WARN("conditional mandatory parameter " + << message_params::kIsSubscribed << " missed in hmi response"); is_subscribed = extension->IsSubscribedToInteriorVehicleData(module); temp_hmi_response[app_mngr::strings::msg_params] @@ -344,8 +337,7 @@ void GetInteriorVehicleDataRequest::ProccessSubscription( } if (!is_subscribe_present_in_request && isSubscribed_present_in_response) { - LOG4CXX_WARN(logger_, - "Parameter " << message_params::kIsSubscribed + SDL_LOG_WARN("Parameter " << message_params::kIsSubscribed << " is ignored due to absence '" << message_params::kSubscribe << "' parameter in request"); @@ -364,31 +356,27 @@ void GetInteriorVehicleDataRequest::ProccessSubscription( .asBool(); is_subscribed = response_subscribe; - LOG4CXX_TRACE(logger_, "request_subscribe = " << request_subscribe); - LOG4CXX_TRACE(logger_, "response_subscribe = " << response_subscribe); + SDL_LOG_TRACE("request_subscribe = " << request_subscribe); + SDL_LOG_TRACE("response_subscribe = " << response_subscribe); if (request_subscribe == response_subscribe) { const std::string module_type = ModuleType(); const std::string module_id = ModuleId(); const ModuleUid module(module_type, module_id); if (response_subscribe) { - LOG4CXX_DEBUG(logger_, - "SubscribeToInteriorVehicleData " << app->app_id() << " " - << module_type << " " - << module_id); + SDL_LOG_DEBUG("SubscribeToInteriorVehicleData " + << app->app_id() << " " << module_type << " " << module_id); extension->SubscribeToInteriorVehicleData(module); } else { - LOG4CXX_DEBUG(logger_, - "UnsubscribeFromInteriorVehicleData " - << app->app_id() << " " << module_type << " " - << module_id); + SDL_LOG_DEBUG("UnsubscribeFromInteriorVehicleData " + << app->app_id() << " " << module_type << " " << module_id); extension->UnsubscribeFromInteriorVehicleData(module); } } } bool GetInteriorVehicleDataRequest::HasRequestExcessiveSubscription() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const bool is_subscribe_present_in_request = (*message_)[app_mngr::strings::msg_params].keyExists( message_params::kSubscribe); @@ -416,12 +404,12 @@ bool GetInteriorVehicleDataRequest::HasRequestExcessiveSubscription() { } void GetInteriorVehicleDataRequest::RemoveExcessiveSubscription() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[app_mngr::strings::msg_params].erase(message_params::kSubscribe); } std::string GetInteriorVehicleDataRequest::ModuleType() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); mobile_apis::ModuleType::eType module_type = static_cast<mobile_apis::ModuleType::eType>( (*message_)[app_mngr::strings::msg_params] @@ -434,7 +422,7 @@ std::string GetInteriorVehicleDataRequest::ModuleType() const { } std::string GetInteriorVehicleDataRequest::ModuleId() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto msg_params = (*message_)[app_mngr::strings::msg_params]; if (msg_params.keyExists(message_params::kModuleId)) { return msg_params[message_params::kModuleId].asString(); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc index b1fa8d6ea0..1c19cc641d 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc @@ -37,6 +37,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetInteriorVehicleDataResponse::GetInteriorVehicleDataResponse( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -49,7 +51,7 @@ GetInteriorVehicleDataResponse::GetInteriorVehicleDataResponse( GetInteriorVehicleDataResponse::~GetInteriorVehicleDataResponse() {} void GetInteriorVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); RCHelpers::RemoveRedundantGPSDataFromIVDataMsg( (*message_)[app_mngr::strings::msg_params]); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc index 91ecbe77eb..f7a9ae50bd 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc @@ -40,7 +40,7 @@ namespace rc_rpc_plugin { namespace commands { -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") +SDL_CREATE_LOG_VARIABLE("Commands") OnInteriorVehicleDataNotification::OnInteriorVehicleDataNotification( const app_mngr::commands::MessageSharedPtr& message, @@ -65,7 +65,7 @@ void OnInteriorVehicleDataNotification::AddDataToCache( } void OnInteriorVehicleDataNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const std::string module_type = ModuleType(); const std::string module_id = ModuleId(); @@ -87,10 +87,9 @@ void OnInteriorVehicleDataNotification::Run() { const auto extension = RCHelpers::GetRCExtension(app); DCHECK(extension); - LOG4CXX_TRACE(logger_, - "Check subscription for " << app.app_id() - << "and module type " << module_type - << " " << module_id); + SDL_LOG_TRACE("Check subscription for " + << app.app_id() << "and module type " << module_type << " " + << module_id); if (extension->IsSubscribedToInteriorVehicleData(module)) { (*message_)[app_mngr::strings::params] @@ -105,7 +104,7 @@ void OnInteriorVehicleDataNotification::Run() { } std::string OnInteriorVehicleDataNotification::ModuleId() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto msg_params = (*message_)[app_mngr::strings::msg_params]; if (msg_params[message_params::kModuleData].keyExists( message_params::kModuleId)) { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/release_interior_vehicle_data_module_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/release_interior_vehicle_data_module_request.cc index 375db9cd9d..e7532636b2 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/release_interior_vehicle_data_module_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/release_interior_vehicle_data_module_request.cc @@ -41,6 +41,8 @@ namespace rc_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + namespace { struct ResponseParams { std::string response_info; @@ -90,7 +92,7 @@ ReleaseInteriorVehicleDataModuleRequest:: : RCCommandRequest(message, params) {} bool ReleaseInteriorVehicleDataModuleRequest::ProcessCapabilities() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto rc_capability = hmi_capabilities_.rc_capability(); const std::string module_type = ModuleType(); @@ -98,9 +100,8 @@ bool ReleaseInteriorVehicleDataModuleRequest::ProcessCapabilities() { const ModuleUid module(module_type, module_id); if (rc_capability && !rc_capabilities_manager_.CheckIfModuleExistsInCapabilities(module)) { - LOG4CXX_WARN( - logger_, - "Accessing not supported module: " << module_type << " " << module_id); + SDL_LOG_WARN("Accessing not supported module: " << module_type << " " + << module_id); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE, "Accessing not supported module"); @@ -110,7 +111,7 @@ bool ReleaseInteriorVehicleDataModuleRequest::ProcessCapabilities() { } void ReleaseInteriorVehicleDataModuleRequest::Execute() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!ProcessCapabilities()) { return; @@ -122,7 +123,7 @@ void ReleaseInteriorVehicleDataModuleRequest::Execute() { 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; } @@ -149,12 +150,11 @@ void ReleaseInteriorVehicleDataModuleRequest::Execute() { NotificationTrigger::MODULE_ALLOCATION, app); } - LOG4CXX_DEBUG(logger_, - "Resource for module: " - << ModuleType() << " with id: " << module_id - << " was released with result " << std::boolalpha - << response_params.success_result - << " and result_code: " << response_params.result_code); + SDL_LOG_DEBUG("Resource for module: " + << ModuleType() << " with id: " << module_id + << " was released with result " << std::boolalpha + << response_params.success_result + << " and result_code: " << response_params.result_code); SendResponse(response_params.success_result, response_params.result_code, @@ -162,7 +162,7 @@ void ReleaseInteriorVehicleDataModuleRequest::Execute() { } std::string ReleaseInteriorVehicleDataModuleRequest::ModuleType() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); mobile_apis::ModuleType::eType module_type = static_cast<mobile_apis::ModuleType::eType>( (*message_)[app_mngr::strings::msg_params] @@ -176,7 +176,7 @@ std::string ReleaseInteriorVehicleDataModuleRequest::ModuleType() const { } std::string ReleaseInteriorVehicleDataModuleRequest::ModuleId() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto msg_params = (*message_)[app_mngr::strings::msg_params]; if (msg_params.keyExists(message_params::kModuleId)) { return msg_params[message_params::kModuleId].asString(); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/release_interior_vehicle_data_module_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/release_interior_vehicle_data_module_response.cc index fae792f143..766c523b58 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/release_interior_vehicle_data_module_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/release_interior_vehicle_data_module_response.cc @@ -35,6 +35,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ReleaseInteriorVehicleDataModuleResponse:: ReleaseInteriorVehicleDataModuleResponse( const application_manager::commands::MessageSharedPtr& message, @@ -47,7 +49,7 @@ ReleaseInteriorVehicleDataModuleResponse:: params.policy_handler_) {} void ReleaseInteriorVehicleDataModuleResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); application_manager_.GetRPCService().SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc index dfcc6205b1..8dd4eab306 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc @@ -45,7 +45,7 @@ namespace commands { using namespace json_keys; using namespace message_params; -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") +SDL_CREATE_LOG_VARIABLE("Commands") SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest( const app_mngr::commands::MessageSharedPtr& message, @@ -62,7 +62,7 @@ SetInteriorVehicleDataRequest::~SetInteriorVehicleDataRequest() {} */ bool ClearUnrelatedModuleData(const std::string& module_type, smart_objects::SmartObject& module_data) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto& all_module_types = RCHelpers::GetModuleTypesList(); const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping(); bool module_type_and_data_match = false; @@ -106,11 +106,11 @@ mobile_apis::Result::eType PrepareResultCodeAndInfo( info = "Accessing not supported module data."; } return result_code; - LOG4CXX_WARN(logger_, info); + SDL_LOG_WARN(info); } void SetInteriorVehicleDataRequest::Execute() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject& module_data = (*message_)[app_mngr::strings::msg_params][message_params::kModuleData]; @@ -120,8 +120,7 @@ void SetInteriorVehicleDataRequest::Execute() { const std::string module_id = ModuleId(); const ModuleUid module(module_type, module_id); if (!rc_capabilities_manager_.CheckIfModuleExistsInCapabilities(module)) { - LOG4CXX_WARN(logger_, - "Accessing not supported module: " << module_type << " " + SDL_LOG_WARN("Accessing not supported module: " << module_type << " " << module_id); SetResourceState(ModuleType(), ResourceState::FREE); SendResponse(false, @@ -146,7 +145,7 @@ void SetInteriorVehicleDataRequest::Execute() { if (rc_capabilities_manager_.AreAllParamsReadOnly(module_data, module_type)) { - LOG4CXX_WARN(logger_, "All request params in module type are READ ONLY!"); + SDL_LOG_WARN("All request params in module type are READ ONLY!"); SetResourceState(ModuleType(), ResourceState::FREE); SendResponse(false, mobile_apis::Result::READ_ONLY, @@ -158,7 +157,7 @@ void SetInteriorVehicleDataRequest::Execute() { if (rc_capabilities_manager_.AreReadOnlyParamsPresent( module_data, module_type, module_data_capabilities)) { - LOG4CXX_DEBUG(logger_, "Request module type has READ ONLY parameters"); + SDL_LOG_DEBUG("Request module type has READ ONLY parameters"); if (enums_value::kLight == module_data_capabilities.first && capabilitiesStatus::kSuccess != module_data_capabilities.second) { @@ -170,7 +169,7 @@ void SetInteriorVehicleDataRequest::Execute() { return; } - LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameters... "); + SDL_LOG_DEBUG("Cutting-off READ ONLY parameters... "); CutOffReadOnlyParams(module_data); } @@ -190,7 +189,7 @@ void SetInteriorVehicleDataRequest::Execute() { if (app_wants_to_set_audio_src) { if (!app->IsAllowedToChangeAudioSource()) { - LOG4CXX_WARN(logger_, "App is not allowed to change audio source"); + SDL_LOG_WARN("App is not allowed to change audio source"); SetResourceState(ModuleType(), ResourceState::FREE); SendResponse(false, mobile_apis::Result::REJECTED, @@ -210,7 +209,7 @@ void SetInteriorVehicleDataRequest::Execute() { &(*message_)[app_mngr::strings::msg_params], true); } else { - LOG4CXX_WARN(logger_, "Request module type & data mismatch!"); + SDL_LOG_WARN("Request module type & data mismatch!"); SetResourceState(ModuleType(), ResourceState::FREE); SendResponse(false, mobile_apis::Result::INVALID_DATA, @@ -220,7 +219,7 @@ void SetInteriorVehicleDataRequest::Execute() { void SetInteriorVehicleDataRequest::on_event( const app_mngr::event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); RCCommandRequest::on_event(event); if (hmi_apis::FunctionID::RC_SetInteriorVehicleData != event.id()) { @@ -244,10 +243,8 @@ void SetInteriorVehicleDataRequest::on_event( if (result) { if (!IsModuleIdProvided(hmi_response)) { - LOG4CXX_WARN(logger_, - "conditional mandatory parameter " - << message_params::kModuleId - << " missed in hmi response"); + SDL_LOG_WARN("conditional mandatory parameter " + << message_params::kModuleId << " missed in hmi response"); result = false; result_code = mobile_apis::Result::GENERIC_ERROR; } @@ -265,7 +262,7 @@ void SetInteriorVehicleDataRequest::on_event( auto 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; } @@ -298,7 +295,7 @@ void SetInteriorVehicleDataRequest::on_event( void SetInteriorVehicleDataRequest::CheckAudioSource( const smart_objects::SmartObject& audio_data) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (audio_data.keyExists(message_params::kSource)) { application_manager_.set_current_audio_source( audio_data[message_params::kSource].asUInt()); @@ -307,7 +304,7 @@ void SetInteriorVehicleDataRequest::CheckAudioSource( void SetInteriorVehicleDataRequest::CutOffReadOnlyParams( smart_objects::SmartObject& module_data) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const std::string module_type = ModuleType(); const auto& module_type_params = rc_capabilities_manager_.ControlDataForType(module_data, module_type); @@ -319,9 +316,8 @@ void SetInteriorVehicleDataRequest::CutOffReadOnlyParams( for (; it != equalizer_settings.asArray()->end(); ++it) { if (it->keyExists(message_params::kChannelName)) { it->erase(message_params::kChannelName); - LOG4CXX_DEBUG(logger_, - "Cutting-off READ ONLY parameter: " - << message_params::kChannelName); + SDL_LOG_DEBUG("Cutting-off READ ONLY parameter: " + << message_params::kChannelName); } } } @@ -332,13 +328,13 @@ void SetInteriorVehicleDataRequest::CutOffReadOnlyParams( for (const auto& param : ro_params) { if (module_type_params.keyExists(param)) { module_data[data_mapping(module_type)].erase(param); - LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << param); + SDL_LOG_DEBUG("Cutting-off READ ONLY parameter: " << param); } } } std::string SetInteriorVehicleDataRequest::ModuleType() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); mobile_apis::ModuleType::eType module_type = static_cast<mobile_apis::ModuleType::eType>( (*message_)[app_mngr::strings::msg_params] @@ -351,7 +347,7 @@ std::string SetInteriorVehicleDataRequest::ModuleType() const { } std::string SetInteriorVehicleDataRequest::ModuleId() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto msg_params = (*message_)[app_mngr::strings::msg_params]; if (msg_params[message_params::kModuleData].keyExists( message_params::kModuleId)) { @@ -372,7 +368,7 @@ std::string SetInteriorVehicleDataRequest::ModuleId() const { AcquireResult::eType SetInteriorVehicleDataRequest::AcquireResource( const app_mngr::commands::MessageSharedPtr& message) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const std::string module_type = ModuleType(); app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); @@ -388,7 +384,7 @@ bool SetInteriorVehicleDataRequest::IsResourceFree( void SetInteriorVehicleDataRequest::SetResourceState( const std::string& module_type, const ResourceState::eType state) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); resource_allocation_manager_.SetResourceState( diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc index 4dedd4b5a2..aeab82e12c 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc @@ -5,6 +5,8 @@ namespace rc_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SetInteriorVehicleDataResponse::SetInteriorVehicleDataResponse( const app_mngr::commands::MessageSharedPtr& message, const RCCommandParams& params) @@ -17,7 +19,7 @@ SetInteriorVehicleDataResponse::SetInteriorVehicleDataResponse( SetInteriorVehicleDataResponse::~SetInteriorVehicleDataResponse() {} void SetInteriorVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); application_manager_.GetRPCService().SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc index 98f168c015..53222e0d04 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc @@ -41,7 +41,7 @@ #include "rc_rpc_plugin/rc_module_constants.h" #include "smart_objects/enum_schema_item.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") +SDL_CREATE_LOG_VARIABLE("Commands") namespace rc_rpc_plugin { namespace commands { @@ -75,7 +75,7 @@ bool RCCommandRequest::IsInterfaceAvailable( } void RCCommandRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const std::string module_type = ModuleType(); SetResourceState(module_type, ResourceState::FREE); SendResponse( @@ -83,7 +83,7 @@ void RCCommandRequest::onTimeOut() { } bool RCCommandRequest::CheckDriverConsent() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); @@ -108,14 +108,14 @@ rc_rpc_plugin::TypeAccess RCCommandRequest::CheckModule( bool RCCommandRequest::IsModuleIdProvided( const smart_objects::SmartObject& hmi_response) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); return hmi_response[app_mngr::strings::msg_params] [message_params::kModuleData] .keyExists(message_params::kModuleId); } void RCCommandRequest::SendDisallowed(rc_rpc_plugin::TypeAccess access) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::string info; if (rc_rpc_plugin::kDisallowed == access) { info = disallowed_info_.empty() @@ -124,33 +124,33 @@ void RCCommandRequest::SendDisallowed(rc_rpc_plugin::TypeAccess access) { } else { return; } - LOG4CXX_ERROR(logger_, info); + SDL_LOG_ERROR(info); SendResponse(false, mobile_apis::Result::DISALLOWED, info.c_str()); } void RCCommandRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); if (!IsInterfaceAvailable(app_mngr::HmiInterfaces::HMI_INTERFACE_RC)) { - LOG4CXX_WARN(logger_, "HMI interface RC is not available"); + SDL_LOG_WARN("HMI interface RC is not available"); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE, "RC is not supported by system"); return; } - LOG4CXX_TRACE(logger_, "RC interface is available!"); + SDL_LOG_TRACE("RC interface is available!"); if (!policy_handler_.CheckHMIType( app->policy_app_id(), mobile_apis::AppHMIType::eType::REMOTE_CONTROL, app->app_types())) { - LOG4CXX_WARN(logger_, "Application has no remote control functions"); + SDL_LOG_WARN("Application has no remote control functions"); SendResponse(false, mobile_apis::Result::DISALLOWED, ""); return; } if (!resource_allocation_manager_.is_rc_enabled()) { - LOG4CXX_WARN(logger_, "Remote control is disabled by user"); + SDL_LOG_WARN("Remote control is disabled by user"); SetResourceState(ModuleType(), ResourceState::FREE); SendResponse(false, mobile_apis::Result::USER_DISALLOWED, @@ -159,7 +159,7 @@ void RCCommandRequest::Run() { } auto rc_capability = hmi_capabilities_.rc_capability(); if (!rc_capability || rc_capability->empty()) { - LOG4CXX_WARN(logger_, "Accessing not supported module: " << ModuleType()); + SDL_LOG_WARN("Accessing not supported module: " << ModuleType()); SetResourceState(ModuleType(), ResourceState::FREE); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE, @@ -178,12 +178,12 @@ void RCCommandRequest::Run() { } bool RCCommandRequest::AcquireResources() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const std::string module_type = ModuleType(); const std::string module_id = ModuleId(); if (!IsResourceFree(module_type, module_id)) { - LOG4CXX_WARN(logger_, "Resource is busy."); + SDL_LOG_WARN("Resource is busy."); SendResponse(false, mobile_apis::Result::IN_USE, ""); return false; } @@ -211,7 +211,7 @@ bool RCCommandRequest::AcquireResources() { } void RCCommandRequest::on_event(const app_mngr::event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (event.id() == hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent) { ProcessAccessResponse(event); @@ -223,13 +223,13 @@ void RCCommandRequest::on_event(const app_mngr::event_engine::Event& event) { void RCCommandRequest::ProcessAccessResponse( const app_mngr::event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); const std::string module_type = ModuleType(); const std::string module_id = ModuleId(); if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer."); + SDL_LOG_ERROR("NULL pointer."); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED, ""); return; } @@ -275,7 +275,7 @@ void RCCommandRequest::ProcessConsentResult(const bool is_allowed, const std::string& module_type, const std::string& module_id, const uint32_t app_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (is_allowed) { SetResourceState(module_type, ResourceState::BUSY); Execute(); // run child's logic @@ -293,7 +293,7 @@ void RCCommandRequest::ProcessConsentResult(const bool is_allowed, void RCCommandRequest::ProcessAskDriverMode(const std::string& module_type, const std::string& module_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto app = application_manager_.application(CommandRequestImpl::connection_key()); const std::string policy_app_id = app->policy_app_id(); @@ -321,7 +321,7 @@ void RCCommandRequest::ProcessAskDriverMode(const std::string& module_type, void RCCommandRequest::SendGetUserConsent( const std::string& module_type, const smart_objects::SmartObject& module_ids) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); DCHECK(app); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc index 3e50818210..ab33fde764 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc @@ -41,7 +41,7 @@ namespace rc_rpc_plugin { -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule"); +SDL_CREATE_LOG_VARIABLE("RemoteControlModule"); InteriorDataCacheImpl::InteriorDataCacheImpl() {} @@ -49,9 +49,8 @@ InteriorDataCacheImpl::~InteriorDataCacheImpl() {} void InteriorDataCacheImpl::Add(const ModuleUid& module, const smart_objects::SmartObject& module_data) { - LOG4CXX_TRACE( - logger_, - "module_type : " << module.first << " module_id : " << module.second); + SDL_LOG_TRACE("module_type : " << module.first + << " module_id : " << module.second); sync_primitives::AutoLock autolock(cached_data_lock_); auto it = cached_data_.find(module); if (cached_data_.end() == it) { @@ -63,19 +62,17 @@ void InteriorDataCacheImpl::Add(const ModuleUid& module, smart_objects::SmartObject InteriorDataCacheImpl::Retrieve( const ModuleUid& module) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock autolock(cached_data_lock_); auto it = cached_data_.find(module); if (it == cached_data_.end()) { - LOG4CXX_WARN(logger_, - "Module with type: " << module.first + SDL_LOG_WARN("Module with type: " << module.first << " and id: " << module.second << " was not found in cache"); return smart_objects::SmartObject(smart_objects::SmartType_Null); } - LOG4CXX_TRACE( - logger_, - "module_type : " << module.first << " module_id : " << module.second); + SDL_LOG_TRACE("module_type : " << module.first + << " module_id : " << module.second); return it->second; } @@ -92,34 +89,31 @@ std::vector<ModuleUid> InteriorDataCacheImpl::GetCachedModulesByType( } bool InteriorDataCacheImpl::Contains(const ModuleUid& module) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock autolock(cached_data_lock_); auto it = cached_data_.find(module); const bool contains = it != cached_data_.end(); - LOG4CXX_TRACE(logger_, - "module_type : " << module.first + SDL_LOG_TRACE("module_type : " << module.first << " module_id : " << module.second << " " << (contains ? "true" : "false")); return contains; } void InteriorDataCacheImpl::Remove(const ModuleUid& module) { - LOG4CXX_TRACE( - logger_, - "module_type : " << module.first << " module_id : " << module.second); + SDL_LOG_TRACE("module_type : " << module.first + << " module_id : " << module.second); sync_primitives::AutoLock autolock(cached_data_lock_); auto it = cached_data_.find(module); if (cached_data_.end() == it) { - LOG4CXX_TRACE( - logger_, - "Not existing module : " << module.first << " " << module.second); + SDL_LOG_TRACE("Not existing module : " << module.first << " " + << module.second); return; } cached_data_.erase(it); } void InteriorDataCacheImpl::Clear() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock autolock(cached_data_lock_); cached_data_.clear(); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc index 50568de63a..a4d4026da7 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc @@ -5,7 +5,7 @@ #include "rc_rpc_plugin/rc_rpc_plugin.h" namespace rc_rpc_plugin { -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule"); +SDL_CREATE_LOG_VARIABLE("RemoteControlModule"); InteriorDataManagerImpl::InteriorDataManagerImpl( RCRPCPlugin& rc_plugin, @@ -31,7 +31,7 @@ void InteriorDataManagerImpl::OnApplicationEvent( } void InteriorDataManagerImpl::OnDisablingRC() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto existing_subscription = AppsSubscribedModules(); std::set<ModuleUid> subscribed_modules; for (auto& pair : existing_subscription) { @@ -43,22 +43,21 @@ void InteriorDataManagerImpl::OnDisablingRC() { } } for (auto& module : subscribed_modules) { - LOG4CXX_TRACE(logger_, - "unsubscribe from module type: " << module.first + SDL_LOG_TRACE("unsubscribe from module type: " << module.first << " id: " << module.second); UnsubscribeFromInteriorVehicleData(module); } } void InteriorDataManagerImpl::StoreRequestToHMITime(const ModuleUid& module) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock autolock(requests_to_hmi_history_lock_); requests_to_hmi_history_[module].push_back(date_time::getCurrentTime()); } bool InteriorDataManagerImpl::CheckRequestsToHMIFrequency( const ModuleUid& module) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock autolock(requests_to_hmi_history_lock_); ClearOldRequestsToHMIHistory(); const auto& history = requests_to_hmi_history_[module]; @@ -107,7 +106,7 @@ void InteriorDataManagerImpl::UpdateHMISubscriptionsOnPolicyUpdated() { void InteriorDataManagerImpl::UpdateHMISubscriptionsOnAppUnregistered( application_manager::Application& app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto rc_extension = RCHelpers::GetRCExtension(app); auto subscribed_data = rc_extension->InteriorVehicleDataSubscriptions(); rc_extension->UnsubscribeFromInteriorVehicleData(); @@ -128,8 +127,7 @@ void InteriorDataManagerImpl::UnsubscribeFromInteriorVehicleData( cache_.Remove(module); auto unsubscribe_request = RCHelpers::CreateUnsubscribeRequestToHMI( module, app_mngr_.GetNextHMICorrelationID()); - LOG4CXX_DEBUG(logger_, - "Send Unsubscribe from module type: " << module.first << " id: " + SDL_LOG_DEBUG("Send Unsubscribe from module type: " << module.first << " id: " << module.second); rpc_service_.ManageHMICommand(unsubscribe_request); } @@ -142,9 +140,8 @@ void InteriorDataManagerImpl::UnsubscribeFromInteriorVehicleDataOfType( cache_.Remove(module); auto unsubscribe_request = RCHelpers::CreateUnsubscribeRequestToHMI( module, app_mngr_.GetNextHMICorrelationID()); - LOG4CXX_DEBUG(logger_, - "Send Unsubscribe from module type: " - << module.first << " id: " << module.second); + SDL_LOG_DEBUG("Send Unsubscribe from module type: " + << module.first << " id: " << module.second); rpc_service_.ManageHMICommand(unsubscribe_request); } } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_capabilities_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_capabilities_manager_impl.cc index 0f68769b38..75ccd46e4d 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_capabilities_manager_impl.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_capabilities_manager_impl.cc @@ -35,7 +35,7 @@ #include "rc_rpc_plugin/rc_module_constants.h" namespace rc_rpc_plugin { -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") +SDL_CREATE_LOG_VARIABLE("RemoteControlModule") RCCapabilitiesManagerImpl::RCCapabilitiesManagerImpl( application_manager::HMICapabilities& hmi_capabilities) @@ -45,22 +45,20 @@ const std::string RCCapabilitiesManagerImpl::GetDefaultModuleIdFromCapabilitiesStructure( const smart_objects::SmartObject& control_capabilities, const std::string& module_type) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (control_capabilities.keyExists(message_params::kModuleInfo)) { // moduleId - mandatory param for ModuleInfo structure const auto module_id = control_capabilities[message_params::kModuleInfo] [message_params::kModuleId] .asString(); - LOG4CXX_WARN(logger_, - "Use default moduleId from hmi capabilities: " - << module_id - << " for requested moduleType: " << module_type); + SDL_LOG_WARN("Use default moduleId from hmi capabilities: " + << module_id << " for requested moduleType: " << module_type); return module_id; } - LOG4CXX_WARN(logger_, - "There are no moduleInfo in hmi capabilities for requested " - "moduleType " - << module_type); + SDL_LOG_WARN( + "There are no moduleInfo in hmi capabilities for requested " + "moduleType " + << module_type); return ""; } @@ -68,42 +66,40 @@ const std::string RCCapabilitiesManagerImpl::GetDefaultModuleIdFromCapabilitiesArray( const smart_objects::SmartObject& control_capabilities, const std::string& module_type) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); for (auto& cap_item : *(control_capabilities.asArray())) { if (cap_item.keyExists(message_params::kModuleInfo)) { // moduleId - mandatory param for ModuleInfo structure const auto module_id = cap_item[message_params::kModuleInfo][message_params::kModuleId] .asString(); - LOG4CXX_WARN(logger_, - "Use default moduleId from hmi capabilities: " - << module_id - << " for requested moduleType: " << module_type); + SDL_LOG_WARN("Use default moduleId from hmi capabilities: " + << module_id + << " for requested moduleType: " << module_type); return module_id; } } - LOG4CXX_WARN(logger_, - "There are no moduleInfo in hmi capabilities for requested " - "moduleType " - << module_type); + SDL_LOG_WARN( + "There are no moduleInfo in hmi capabilities for requested " + "moduleType " + << module_type); return ""; } const std::string RCCapabilitiesManagerImpl::GetDefaultModuleIdFromCapabilities( const std::string& module_type) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto rc_capabilities_ptr = hmi_capabilities_.rc_capability(); if (!rc_capabilities_ptr) { - LOG4CXX_WARN(logger_, "RC capability is not initialized"); + SDL_LOG_WARN("RC capability is not initialized"); return std::string(); } auto rc_capabilities = *rc_capabilities_ptr; const auto& mapping = RCHelpers::GetModuleTypeToCapabilitiesMapping(); if (!rc_capabilities.keyExists(mapping(module_type))) { - LOG4CXX_WARN( - logger_, - "There is no RC capability for requested module_type " << module_type); + SDL_LOG_WARN("There is no RC capability for requested module_type " + << module_type); return ""; } if (enums_value::kHmiSettings == module_type || @@ -118,24 +114,24 @@ const std::string RCCapabilitiesManagerImpl::GetDefaultModuleIdFromCapabilities( const bool RCCapabilitiesManagerImpl::CheckModuleIdWithCapabilitiesStructure( const smart_objects::SmartObject& control_capabilities, const std::string& module_id) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (control_capabilities.keyExists(message_params::kModuleInfo) && (module_id == control_capabilities[message_params::kModuleInfo] [message_params::kModuleId] .asString())) { return true; } - LOG4CXX_WARN(logger_, - "There are no moduleInfo in hmi capabilities for requested " - "moduleId " - << module_id); + SDL_LOG_WARN( + "There are no moduleInfo in hmi capabilities for requested " + "moduleId " + << module_id); return false; } const bool RCCapabilitiesManagerImpl::CheckModuleIdWithCapabilitiesArrays( const smart_objects::SmartObject& control_capabilities, const std::string& module_id) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); for (auto& cap_item : *(control_capabilities.asArray())) { if (cap_item.keyExists(message_params::kModuleInfo) && (module_id == @@ -144,17 +140,17 @@ const bool RCCapabilitiesManagerImpl::CheckModuleIdWithCapabilitiesArrays( return true; } } - LOG4CXX_WARN(logger_, - "There are no moduleInfo in hmi capabilities for requested " - "moduleId " - << module_id); + SDL_LOG_WARN( + "There are no moduleInfo in hmi capabilities for requested " + "moduleId " + << module_id); return false; } const bool RCCapabilitiesManagerImpl::CheckModuleIdWithCapabilities( const smart_objects::SmartObject& rc_capabilities, const ModuleUid& module) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (module.second.empty()) { return true; } @@ -170,11 +166,11 @@ const bool RCCapabilitiesManagerImpl::CheckModuleIdWithCapabilities( bool RCCapabilitiesManagerImpl::CheckIfModuleExistsInCapabilities( const ModuleUid& module) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto rc_capabilities_ptr = hmi_capabilities_.rc_capability(); if (!rc_capabilities_ptr) { - LOG4CXX_WARN(logger_, "RC capability is not initialized"); + SDL_LOG_WARN("RC capability is not initialized"); return false; } @@ -217,7 +213,7 @@ RCCapabilitiesManagerImpl::GetCapabilitiesToModuleTypeMapping() const { {strings::khmiSettingsControlCapabilities, enums_value::kHmiSettings}}; auto it = mapping.find(control_cap); if (mapping.end() == it) { - LOG4CXX_ERROR(logger_, "Unknown control capability " << control_cap); + SDL_LOG_ERROR("Unknown control capability " << control_cap); return std::string(); } return it->second; @@ -237,7 +233,7 @@ void RCCapabilitiesManagerImpl::GetResourcesFromCapabilitiesStructure( .asString(); out_resources.push_back(std::make_pair(mapping(capability_key), module_id)); } else { - LOG4CXX_WARN(logger_, "There are no moduleId in " << capability_key); + SDL_LOG_WARN("There are no moduleId in " << capability_key); out_resources.push_back(std::make_pair(mapping(capability_key), "")); } } @@ -255,19 +251,18 @@ void RCCapabilitiesManagerImpl::GetResourcesFromCapabilitiesArray( out_resources.push_back( std::make_pair(mapping(capability_key), module_id)); } else { - LOG4CXX_WARN(logger_, - "There are no moduleId for item from " << capability_key); + SDL_LOG_WARN("There are no moduleId for item from " << capability_key); out_resources.push_back(std::make_pair(mapping(capability_key), "")); } } } const std::vector<ModuleUid> RCCapabilitiesManagerImpl::GetResources() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::vector<ModuleUid> resources; auto rc_capabilities_ptr = hmi_capabilities_.rc_capability(); if (!rc_capabilities_ptr) { - LOG4CXX_WARN(logger_, "RC capability is not initialized"); + SDL_LOG_WARN("RC capability is not initialized"); return resources; } @@ -290,11 +285,11 @@ const std::vector<ModuleUid> RCCapabilitiesManagerImpl::GetResources() const { const std::string RCCapabilitiesManagerImpl::GetModuleIdForSeatLocation( const mobile_apis::SupportedSeat::eType id) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto rc_capabilities_ptr = hmi_capabilities_.rc_capability(); if (!rc_capabilities_ptr) { - LOG4CXX_WARN(logger_, "RC capability is not initialized."); + SDL_LOG_WARN("RC capability is not initialized."); return std::string(); } @@ -314,7 +309,7 @@ const std::string RCCapabilitiesManagerImpl::GetModuleIdForSeatLocation( .asString(); } } - LOG4CXX_DEBUG(logger_, "There are no capabitities for requested id: " << id); + SDL_LOG_DEBUG("There are no capabitities for requested id: " << id); return ""; } @@ -322,7 +317,7 @@ bool RCCapabilitiesManagerImpl::CheckIfButtonExistInRCCaps( const mobile_apis::ButtonName::eType button) const { auto rc_capabilities_ptr = hmi_capabilities_.rc_capability(); if (!rc_capabilities_ptr) { - LOG4CXX_WARN(logger_, "RC capability is not initialized"); + SDL_LOG_WARN("RC capability is not initialized"); return false; } @@ -344,15 +339,13 @@ bool RCCapabilitiesManagerImpl::CheckIfButtonExistInRCCaps( const mobile_apis::ButtonName::eType current_button = static_cast<mobile_apis::ButtonName::eType>(current_id); if (current_button == button) { - LOG4CXX_TRACE( - logger_, - "Button id " << current_button << " exist in capabilities"); + SDL_LOG_TRACE("Button id " << current_button + << " exist in capabilities"); return true; } } } - LOG4CXX_TRACE(logger_, - "Button id " << button << " do not exist in capabilities"); + SDL_LOG_TRACE("Button id " << button << " do not exist in capabilities"); return false; } @@ -368,33 +361,30 @@ RCCapabilitiesManagerImpl::GetCapabilitiesByModuleIdFromArray( return cap_item; } } - LOG4CXX_WARN(logger_, - "Capabilities for moduleId " << module_id + SDL_LOG_WARN("Capabilities for moduleId " << module_id << " do not exist in capabilities"); return smart_objects::SmartObject(smart_objects::SmartType_Null); } bool RCCapabilitiesManagerImpl::CheckButtonName( const std::string& module_type, const std::string& button_name) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto rc_capabilities = hmi_capabilities_.rc_capability(); if (!rc_capabilities) { - LOG4CXX_ERROR(logger_, "No remote controll capabilities available"); + SDL_LOG_ERROR("No remote controll capabilities available"); return false; } if (enums_value::kRadio == module_type) { if (!helpers::in_range(RCHelpers::buttons_radio(), button_name)) { - LOG4CXX_WARN(logger_, - "Trying to acceess climate button with module type radio"); + SDL_LOG_WARN("Trying to acceess climate button with module type radio"); return false; } } if (enums_value::kClimate == module_type) { if (!helpers::in_range(RCHelpers::buttons_climate(), button_name)) { - LOG4CXX_WARN(logger_, - "Trying to acceess radio button with module type climate"); + SDL_LOG_WARN("Trying to acceess radio button with module type climate"); return false; } } @@ -484,10 +474,10 @@ RCCapabilitiesManagerImpl::GetModuleDataToCapabilitiesMapping() const { ModuleTypeCapability RCCapabilitiesManagerImpl::GetModuleDataCapabilities( const smart_objects::SmartObject& module_data, const std::string& module_id) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto rc_capabilities_ptr = hmi_capabilities_.rc_capability(); if (!rc_capabilities_ptr) { - LOG4CXX_WARN(logger_, "RC capability is not initialized"); + SDL_LOG_WARN("RC capability is not initialized"); return {std::string(), capabilitiesStatus::kInvalidStatus}; } @@ -505,7 +495,7 @@ ModuleTypeCapability RCCapabilitiesManagerImpl::GetModuleDataCapabilities( const auto capabilities_key = get_capabilities_key(module_type); if (module_data.keyExists(module_data_key)) { if (!rc_capabilities.keyExists(capabilities_key)) { - LOG4CXX_DEBUG(logger_, module_data_key << " capabilities not present"); + SDL_LOG_DEBUG(module_data_key << " capabilities not present"); return module_data_capabilities; } const auto& caps = rc_capabilities[capabilities_key]; @@ -528,7 +518,7 @@ ModuleTypeCapability RCCapabilitiesManagerImpl::GetModuleDataCapabilities( ModuleTypeCapability RCCapabilitiesManagerImpl::GetControlDataCapabilities( const smart_objects::SmartObject& capabilities, const smart_objects::SmartObject& control_data) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::map<std::string, std::string> mapping = GetModuleDataToCapabilitiesMapping(); @@ -582,31 +572,27 @@ capabilitiesStatus RCCapabilitiesManagerImpl::GetItemCapability( const auto it = mapping.find(request_parameter); if (it == mapping.end()) { - LOG4CXX_DEBUG( - logger_, - "Parameter " << request_parameter << " doesn't exist in capabilities."); + SDL_LOG_DEBUG("Parameter " << request_parameter + << " doesn't exist in capabilities."); return capabilitiesStatus::kMissedParam; } const std::string& caps_key = it->second; - LOG4CXX_DEBUG(logger_, - "Checking request parameter " - << request_parameter - << " with capabilities. Appropriate key is " << caps_key); + SDL_LOG_DEBUG("Checking request parameter " + << request_parameter + << " with capabilities. Appropriate key is " << caps_key); if (!capabilities.keyExists(caps_key)) { - LOG4CXX_DEBUG(logger_, - "Capability " << caps_key + SDL_LOG_DEBUG("Capability " << caps_key << " is missed in RemoteControl capabilities"); return capabilitiesStatus::kMissedParam; } if (!capabilities[caps_key].asBool()) { - LOG4CXX_DEBUG(logger_, - "Capability " - << caps_key - << " is switched off in RemoteControl capabilities"); + SDL_LOG_DEBUG("Capability " + << caps_key + << " is switched off in RemoteControl capabilities"); capabilitiesStatus status = capabilitiesStatus::kMissedParam; if (mobile_apis::Result::READ_ONLY == switched_off_result) { status = capabilitiesStatus::kReadOnly; @@ -620,7 +606,7 @@ capabilitiesStatus RCCapabilitiesManagerImpl::GetItemCapability( ModuleTypeCapability RCCapabilitiesManagerImpl::GetLightDataCapabilities( const smart_objects::SmartObject& capabilities, const smart_objects::SmartObject& control_data) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::map<std::string, std::string> mapping = GetLightCapabilitiesMapping(); for (auto it = control_data.map_begin(); it != control_data.map_end(); ++it) { @@ -648,14 +634,14 @@ ModuleTypeCapability RCCapabilitiesManagerImpl::GetLightDataCapabilities( ModuleTypeCapability RCCapabilitiesManagerImpl::GetLightNameCapabilities( const smart_objects::SmartObject& capabilities_status, const smart_objects::SmartObject& light_data) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); for (auto& so : *(capabilities_status.asArray())) { const int64_t current_id = so[message_params::kName].asInt(); if (current_id == light_data[message_params::kId].asInt()) { return GetLightDataCapabilities(so, light_data); } } - LOG4CXX_DEBUG(logger_, "There is no such light name in capabilities"); + SDL_LOG_DEBUG("There is no such light name in capabilities"); return std::make_pair(message_params::kLightState, capabilitiesStatus::kMissedLightName); } @@ -667,18 +653,16 @@ ModuleTypeCapability RCCapabilitiesManagerImpl::GetRadioBandByCapabilities( static_cast<mobile_apis::RadioBand::eType>(request_parameter.asUInt()); if (mobile_apis::RadioBand::XM == radio_band) { if (!capabilities_status.keyExists(strings::kSiriusxmRadioAvailable)) { - LOG4CXX_DEBUG(logger_, - "Capability " - << strings::kSiriusxmRadioAvailable - << " is missed in RemoteControl capabilities"); + SDL_LOG_DEBUG("Capability " + << strings::kSiriusxmRadioAvailable + << " is missed in RemoteControl capabilities"); return std::make_pair(strings::kSiriusxmRadioAvailable, capabilitiesStatus::kMissedParam); } if (!capabilities_status[strings::kSiriusxmRadioAvailable].asBool()) { - LOG4CXX_DEBUG(logger_, - "Capability " - << strings::kSiriusxmRadioAvailable - << " is switched off in RemoteControl capabilities"); + SDL_LOG_DEBUG("Capability " + << strings::kSiriusxmRadioAvailable + << " is switched off in RemoteControl capabilities"); return std::make_pair(strings::kSiriusxmRadioAvailable, capabilitiesStatus::kMissedParam); } @@ -708,9 +692,8 @@ bool RCCapabilitiesManagerImpl::CheckReadOnlyParamsForAudio( for (auto& so : *(equalizer_settings.asArray())) { if (so.keyExists(message_params::kChannelName)) { - LOG4CXX_DEBUG(logger_, - "READ ONLY parameter. ChannelName = " - << so[message_params::kChannelName].asString()); + SDL_LOG_DEBUG("READ ONLY parameter. ChannelName = " + << so[message_params::kChannelName].asString()); return true; } } @@ -737,10 +720,8 @@ bool RCCapabilitiesManagerImpl::CheckReadOnlyParamsForLight( mobile_apis::LightStatus::RAMP_DOWN, mobile_apis::LightStatus::UNKNOWN, mobile_apis::LightStatus::INVALID)) { - LOG4CXX_DEBUG( - logger_, - "READ ONLY parameter. Status = " - << light_data[message_params::kLightStatus].asInt()); + SDL_LOG_DEBUG("READ ONLY parameter. Status = " + << light_data[message_params::kLightStatus].asInt()); return true; } } @@ -754,7 +735,7 @@ bool RCCapabilitiesManagerImpl::AreReadOnlyParamsPresent( const smart_objects::SmartObject& module_data, const std::string& module_type, ModuleTypeCapability& module_data_capabilities) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& module_type_params = ControlDataForType(module_data, module_type); @@ -787,7 +768,7 @@ bool RCCapabilitiesManagerImpl::AreReadOnlyParamsPresent( bool RCCapabilitiesManagerImpl::AreAllParamsReadOnly( const smart_objects::SmartObject& module_data, const std::string& module_type) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& module_type_params = ControlDataForType(module_data, module_type); auto it = module_type_params.map_begin(); @@ -799,15 +780,15 @@ bool RCCapabilitiesManagerImpl::AreAllParamsReadOnly( } } - LOG4CXX_DEBUG(logger_, "All params are ReadOnly"); + SDL_LOG_DEBUG("All params are ReadOnly"); return true; } bool RCCapabilitiesManagerImpl::IsSeatLocationCapabilityProvided() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto seat_location_capability = hmi_capabilities_.seat_location_capability(); if (!seat_location_capability || seat_location_capability->empty()) { - LOG4CXX_DEBUG(logger_, "Seat Location capability is not provided by HMI"); + SDL_LOG_DEBUG("Seat Location capability is not provided by HMI"); return false; } @@ -821,15 +802,14 @@ bool RCCapabilitiesManagerImpl::IsSeatLocationCapabilityProvided() const { } } - LOG4CXX_DEBUG( - logger_, + SDL_LOG_DEBUG( "Seat Location capability doesn't contain all necessary parameters"); return false; } const Grid RCCapabilitiesManagerImpl::GetDriverLocationFromSeatLocationCapability() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); Grid grid; if (IsSeatLocationCapabilityProvided()) { auto seat_location_capability = @@ -845,7 +825,7 @@ RCCapabilitiesManagerImpl::GetDriverLocationFromSeatLocationCapability() const { driver_location[strings::kRowspan].asInt(), driver_location[strings::kLevelspan].asInt()); } else { - LOG4CXX_DEBUG(logger_, "Driver's location doesn't provided"); + SDL_LOG_DEBUG("Driver's location doesn't provided"); } } return grid; @@ -909,7 +889,7 @@ Grid RCCapabilitiesManagerImpl::GetModuleServiceArea( const ModuleUid& module) const { auto rc_capabilities_ptr = hmi_capabilities_.rc_capability(); if (!rc_capabilities_ptr) { - LOG4CXX_WARN(logger_, "RC capability is not initialized"); + SDL_LOG_WARN("RC capability is not initialized"); return Grid(); } @@ -918,7 +898,7 @@ Grid RCCapabilitiesManagerImpl::GetModuleServiceArea( const auto& module_type = module.first; const auto& capabilities_key = mapping(module_type); if (!rc_capabilities.keyExists(capabilities_key)) { - LOG4CXX_DEBUG(logger_, module_type << "control capabilities not present"); + SDL_LOG_DEBUG(module_type << "control capabilities not present"); return Grid(); } const auto& caps = rc_capabilities[capabilities_key]; @@ -949,7 +929,7 @@ bool RCCapabilitiesManagerImpl::IsMultipleAccessAllowed( const ModuleUid& module) const { auto rc_capabilities_ptr = hmi_capabilities_.rc_capability(); if (!rc_capabilities_ptr) { - LOG4CXX_ERROR(logger_, "RC capability is not initialized"); + SDL_LOG_ERROR("RC capability is not initialized"); return false; } @@ -958,7 +938,7 @@ bool RCCapabilitiesManagerImpl::IsMultipleAccessAllowed( const auto& module_type = module.first; const auto& capabilities_key = mapping(module_type); if (!rc_capabilities.keyExists(capabilities_key)) { - LOG4CXX_DEBUG(logger_, module_type << "control capabilities not present"); + SDL_LOG_DEBUG(module_type << "control capabilities not present"); return false; } const auto& caps = rc_capabilities[capabilities_key]; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc index 4ca2cf5182..e2b67effee 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc @@ -62,7 +62,7 @@ #include "rc_rpc_plugin/interior_data_cache.h" #include "rc_rpc_plugin/resource_allocation_manager.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") +SDL_CREATE_LOG_VARIABLE("RemoteControlModule") namespace application_manager { using rc_rpc_plugin::InteriorDataCache; using rc_rpc_plugin::RCCommandParams; @@ -113,7 +113,7 @@ struct RCCommandCreatorFactory { template <typename RCCommandType> CommandCreator& GetCreator() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); static RCCommandCreator<RCCommandType> res(params_); return res; } @@ -178,9 +178,8 @@ bool RCCommandFactory::IsAbleToProcess( CommandCreator& RCCommandFactory::get_mobile_command_creator( const mobile_apis::FunctionID::eType id, const mobile_apis::messageType::eType message_type) const { - LOG4CXX_DEBUG(logger_, - "get_mobile_command_creator function_id: " - << id << " message_type: " << message_type); + SDL_LOG_DEBUG("get_mobile_command_creator function_id: " + << id << " message_type: " << message_type); RCCommandCreatorFactory rc_factory(params_); switch (id) { case mobile_apis::FunctionID::ButtonPressID: { @@ -266,8 +265,7 @@ CommandCreator& RCCommandFactory::get_mobile_creator_factory( CommandCreator& RCCommandFactory::get_hmi_creator_factory( const hmi_apis::FunctionID::eType id, const hmi_apis::messageType::eType message_type) const { - LOG4CXX_DEBUG(logger_, - "CreateHMICommand function_id: " << id << " message_type: " + SDL_LOG_DEBUG("CreateHMICommand function_id: " << id << " message_type: " << message_type); RCCommandCreatorFactory rc_factory(params_); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_consent_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_consent_manager_impl.cc index 1d7db181eb..e851e65adc 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_consent_manager_impl.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_consent_manager_impl.cc @@ -45,7 +45,7 @@ namespace rc_rpc_plugin { namespace app_mngr = application_manager; -CREATE_LOGGERPTR_GLOBAL(logger_, "RCConsentManager") +SDL_CREATE_LOG_VARIABLE("RCConsentManager") RCConsentManagerImpl::RCConsentManagerImpl( resumption::LastStateWrapperPtr last_state, @@ -59,7 +59,7 @@ void RCConsentManagerImpl::SaveModuleConsents( const std::string& policy_app_id, const std::string& mac_address, const rc_rpc_types::ModuleIdConsentVector& module_consents) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); for (const auto& consent : module_consents) { std::string module_type = consent.module_id.first; @@ -90,9 +90,8 @@ rc_rpc_types::ModuleConsent RCConsentManagerImpl::GetModuleConsent( last_state_accessor.GetMutableData().set_dictionary(last_state_dictionary); if (module_consents.empty()) { - LOG4CXX_DEBUG( - logger_, - "For app: " << app_id << " module type doesn't have any consents"); + SDL_LOG_DEBUG("For app: " << app_id + << " module type doesn't have any consents"); return rc_rpc_types::ModuleConsent::NOT_EXISTS; } @@ -103,8 +102,7 @@ rc_rpc_types::ModuleConsent RCConsentManagerImpl::GetModuleConsent( } } - LOG4CXX_DEBUG(logger_, - "For app: " << app_id << " and module resource [" + SDL_LOG_DEBUG("For app: " << app_id << " and module resource [" << module_id.first << ":" << module_id.second << "] consent is absent"); @@ -112,7 +110,7 @@ rc_rpc_types::ModuleConsent RCConsentManagerImpl::GetModuleConsent( } void RCConsentManagerImpl::RemoveExpiredConsents() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto last_state_accessor = last_state_->get_accessor(); auto last_state_dictionary = last_state_accessor.GetData().dictionary(); @@ -147,7 +145,7 @@ void RCConsentManagerImpl::RemoveAllConsents() { rc_rpc_types::ModuleConsentState RCConsentManagerImpl::CheckModuleConsentState( const Json::Value& module_consent) const { if (!module_consent.isMember(message_params::kConsentDate)) { - LOG4CXX_DEBUG(logger_, "Date of consent is absent"); + SDL_LOG_DEBUG("Date of consent is absent"); return rc_rpc_types::ModuleConsentState::NOT_EXISTS; } @@ -160,10 +158,9 @@ rc_rpc_types::ModuleConsentState RCConsentManagerImpl::CheckModuleConsentState( const auto past_period_in_days = date_time::calculateAmountDaysFromDate(consent_date); - LOG4CXX_DEBUG( - logger_, - "Keeping time of consent is: " << past_period_in_days << " days"); - LOG4CXX_DEBUG(logger_, "Period for expired: " << period_for_expiring); + SDL_LOG_DEBUG("Keeping time of consent is: " << past_period_in_days + << " days"); + SDL_LOG_DEBUG("Period for expired: " << period_for_expiring); return (past_period_in_days >= period_for_expiring) ? rc_rpc_types::ModuleConsentState::EXPIRED @@ -205,17 +202,15 @@ void RCConsentManagerImpl::RemoveModuleExpiredConsents( const bool is_expired = rc_rpc_types::ModuleConsentState::EXPIRED == CheckModuleConsentState(consent); if (is_expired) { - LOG4CXX_DEBUG(logger_, - "Consent for module resource [" - << consent[message_params::kModuleId].asString() - << "] is expired and will be removed"); + SDL_LOG_DEBUG("Consent for module resource [" + << consent[message_params::kModuleId].asString() + << "] is expired and will be removed"); } if (is_module_id_exists && !is_expired) { - LOG4CXX_DEBUG(logger_, - "Consent for module resource [" - << consent[message_params::kModuleId].asString() - << "] is actual."); + SDL_LOG_DEBUG("Consent for module resource [" + << consent[message_params::kModuleId].asString() + << "] is actual."); temp_consents.append(consent); } } @@ -232,14 +227,14 @@ Json::Value& RCConsentManagerImpl::GetRemoteControlDataOrAppend( if (!last_state_data.isMember(app_mngr::strings::remote_control)) { last_state_data[app_mngr::strings::remote_control] = Json::Value(Json::objectValue); - LOG4CXX_DEBUG(logger_, "remote_control section is missed"); + SDL_LOG_DEBUG("remote_control section is missed"); } Json::Value& remote_control = last_state_data[app_mngr::strings::remote_control]; if (!remote_control.isObject()) { - LOG4CXX_ERROR(logger_, "remote_control type INVALID rewrite"); + SDL_LOG_ERROR("remote_control type INVALID rewrite"); remote_control = Json::Value(Json::objectValue); } return remote_control; @@ -252,7 +247,7 @@ Json::Value& RCConsentManagerImpl::GetDeviceApplicationsOrAppend( auto& apps_consents = GetAppsConsentsOrAppend(last_state_data); if (!apps_consents.isArray()) { - LOG4CXX_DEBUG(logger_, "applications_consents type INVALID rewrite"); + SDL_LOG_DEBUG("applications_consents type INVALID rewrite"); apps_consents = Json::Value(Json::arrayValue); } @@ -288,7 +283,7 @@ Json::Value& RCConsentManagerImpl::GetAppConsentsListOrAppend( sync_primitives::AutoLock autolock(applications_lock_); if (!device_applications.isArray()) { - LOG4CXX_DEBUG(logger_, "applications_consents type INVALID rewrite"); + SDL_LOG_DEBUG("applications_consents type INVALID rewrite"); device_applications = Json::Value(Json::arrayValue); } @@ -323,14 +318,14 @@ Json::Value& RCConsentManagerImpl::GetAppsConsentsOrAppend( sync_primitives::AutoLock autolock(remote_control_lock_); if (!remote_control.isMember(message_params::kAppConsents)) { - LOG4CXX_DEBUG(logger_, "app_consents section is missed"); + SDL_LOG_DEBUG("app_consents section is missed"); remote_control[message_params::kAppConsents] = Json::Value(Json::arrayValue); } auto& app_consents = remote_control[message_params::kAppConsents]; if (!app_consents.isArray()) { - LOG4CXX_DEBUG(logger_, "applications_consents type INVALID rewrite"); + SDL_LOG_DEBUG("applications_consents type INVALID rewrite"); app_consents = Json::Value(Json::arrayValue); } return app_consents; @@ -358,10 +353,8 @@ Json::Value& RCConsentManagerImpl::GetModuleTypeConsentsOrAppend( // In case of absent specified module_type in section of specified // application, will be added empty section with this module type. - LOG4CXX_DEBUG( - logger_, - "Section module_type: " << module_type - << " is missed for app_id:" << policy_app_id); + SDL_LOG_DEBUG("Section module_type: " + << module_type << " is missed for app_id:" << policy_app_id); auto consent_item = Json::Value(Json::objectValue); consent_item[message_params::kModuleType] = module_type; consent_item[message_params::kModuleConsents] = Json::Value(Json::arrayValue); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc index f344dd15a7..dea7203717 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc @@ -6,7 +6,7 @@ #include "rc_rpc_plugin/rc_rpc_plugin.h" namespace rc_rpc_plugin { -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule"); +SDL_CREATE_LOG_VARIABLE("RemoteControlModule"); const std::vector<std::string> RCHelpers::buttons_climate() { std::vector<std::string> data; @@ -138,7 +138,7 @@ RCHelpers::GetModuleTypeToDataMapping() { {enums_value::kHmiSettings, message_params::kHmiSettingsControlData}}; auto it = mapping.find(module_type); if (mapping.end() == it) { - LOG4CXX_ERROR(logger_, "Unknown module type" << module_type); + SDL_LOG_ERROR("Unknown module type " << module_type); return std::string(); } return it->second; @@ -159,7 +159,7 @@ RCHelpers::GetModuleTypeToCapabilitiesMapping() { {enums_value::kHmiSettings, strings::khmiSettingsControlCapabilities}}; auto it = mapping.find(module_type); if (mapping.end() == it) { - LOG4CXX_ERROR(logger_, "Unknown module type" << module_type); + SDL_LOG_ERROR("Unknown module type " << module_type); return std::string(); } return it->second; @@ -175,7 +175,7 @@ const std::vector<std::string> RCHelpers::GetModuleTypesList() { RCAppExtensionPtr RCHelpers::GetRCExtension( application_manager::Application& app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto extension_interface = app.QueryInterface(RCRPCPlugin::kRCPluginID); auto extension = std::static_pointer_cast<RCAppExtension>(extension_interface); @@ -257,7 +257,7 @@ void RCHelpers::RemoveRedundantGPSDataFromIVDataMsg( using namespace message_params; using namespace application_manager::strings; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!msg_params.keyExists(kModuleData)) { return; } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc index c2aa639fda..6e9a751bb6 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc @@ -43,7 +43,7 @@ #include "utils/helpers.h" namespace rc_rpc_plugin { -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule"); +SDL_CREATE_LOG_VARIABLE("RemoteControlModule"); namespace plugins = application_manager::plugin_manager; @@ -115,12 +115,11 @@ void RCRPCPlugin::OnPolicyEvent( void RCRPCPlugin::OnApplicationEvent( application_manager::plugin_manager::ApplicationEvent event, application_manager::ApplicationSharedPtr application) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!application->is_remote_control_supported()) { - LOG4CXX_DEBUG( - logger_, + SDL_LOG_DEBUG( "Remote control is not supported for application with app_id: " - << application->app_id()); + << application->app_id()); return; } switch (event) { @@ -179,12 +178,12 @@ RCRPCPlugin::Apps RCRPCPlugin::GetRCApplications( extern "C" __attribute__((visibility("default"))) application_manager::plugin_manager::RPCPlugin* -Create() { +Create(logger::Logger* logger_instance) { + logger::Logger::instance(logger_instance); return new rc_rpc_plugin::RCRPCPlugin(); } // namespace rc_rpc_plugin extern "C" __attribute__((visibility("default"))) void Delete( application_manager::plugin_manager::RPCPlugin* data) { delete data; - DELETE_THREAD_LOGGER(rc_rpc_plugin::logger_); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc index 049f9a3cf3..fe9bb5eec3 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc @@ -45,7 +45,7 @@ namespace rc_rpc_plugin { -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") +SDL_CREATE_LOG_VARIABLE("RemoteControlModule") ResourceAllocationManagerImpl::ResourceAllocationManagerImpl( application_manager::ApplicationManager& app_mngr, @@ -63,11 +63,11 @@ AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource( const std::string& module_type, const std::string& module_id, const uint32_t app_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const application_manager::ApplicationSharedPtr acquiring_app = app_mngr_.application(app_id); if (!acquiring_app) { - LOG4CXX_WARN(logger_, "App with app_id: " << app_id << "does not exist!"); + SDL_LOG_WARN("App with app_id: " << app_id << " does not exist!"); return AcquireResult::IN_USE; } @@ -75,9 +75,9 @@ AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource( if (rc_capabilities_manager_.IsSeatLocationCapabilityProvided() && !IsUserLocationValid(module, acquiring_app)) { - LOG4CXX_WARN(logger_, - "Resource acquisition is not allowed " - "according to location verification."); + SDL_LOG_WARN( + "Resource acquisition is not allowed " + "according to location verification."); return AcquireResult::REJECTED; } @@ -85,23 +85,20 @@ AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource( const AllocatedResources::const_iterator allocated_it = allocated_resources_.find(module); if (allocated_resources_.end() == allocated_it) { - LOG4CXX_DEBUG(logger_, - "Resource is not acquired yet. " - << "App: " << app_id << " is allowed to acquire " - << module_type << " " << module_id); + SDL_LOG_DEBUG("Resource is not acquired yet. " + << "App: " << app_id << " is allowed to acquire " + << module_type << " " << module_id); return AcquireResult::ALLOWED; } if (app_id == allocated_resources_[module]) { - LOG4CXX_DEBUG(logger_, - "App: " << app_id << " is already acquired resource " + SDL_LOG_DEBUG("App: " << app_id << " is already acquired resource " << module_type << " " << module_id); return AcquireResult::ALLOWED; } if (IsModuleTypeRejected(module_type, module_id, app_id)) { - LOG4CXX_DEBUG(logger_, - "Driver disallowed app: " << app_id << " to acquire " + SDL_LOG_DEBUG("Driver disallowed app: " << app_id << " to acquire " << module_type << " " << module_id); return AcquireResult::REJECTED; } @@ -110,42 +107,37 @@ AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource( acquiring_app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW); if (mobile_apis::HMILevel::HMI_FULL != acquiring_app_hmi_level) { - LOG4CXX_DEBUG(logger_, - "Aquiring resources is not allowed in HMI level: " - << acquiring_app_hmi_level << ". App: " << app_id - << " is disallowed to acquire " << module_type << " " - << module_id); + SDL_LOG_DEBUG("Acquiring resources is not allowed in HMI level: " + << acquiring_app_hmi_level << ". App: " << app_id + << " is disallowed to acquire " << module_type << " " + << module_id); return AcquireResult::REJECTED; } if (!rc_capabilities_manager_.IsMultipleAccessAllowed(module)) { - LOG4CXX_DEBUG(logger_, - "Multiple access for the: " << module_type << " " << module_id + SDL_LOG_DEBUG("Multiple access for the: " << module_type << " " << module_id << " isn't allowed"); return AcquireResult::REJECTED; } switch (current_access_mode_) { case hmi_apis::Common_RCAccessMode::AUTO_DENY: { - LOG4CXX_DEBUG(logger_, - "Current access_mode is AUTO_DENY. " - << "App: " << app_id << " is disallowed to acquire " - << module_type << " " << module_id); + SDL_LOG_DEBUG("Current access_mode is AUTO_DENY. " + << "App: " << app_id << " is disallowed to acquire " + << module_type << " " << module_id); return AcquireResult::IN_USE; } case hmi_apis::Common_RCAccessMode::ASK_DRIVER: { - LOG4CXX_DEBUG(logger_, - "Current access_mode is ASK_DRIVER. " - "Driver confirmation is required for app: " - << app_id << " to acquire " << module_type << " " - << module_id); + SDL_LOG_DEBUG( + "Current access_mode is ASK_DRIVER. " + "Driver confirmation is required for app: " + << app_id << " to acquire " << module_type << " " << module_id); return AcquireResult::ASK_DRIVER; } case hmi_apis::Common_RCAccessMode::AUTO_ALLOW: { - LOG4CXX_DEBUG(logger_, - "Current access_mode is AUTO_ALLOW. " - << "App: " << app_id << " is allowed to acquire " - << module_type << " " << module_id); + SDL_LOG_DEBUG("Current access_mode is AUTO_ALLOW. " + << "App: " << app_id << " is allowed to acquire " + << module_type << " " << module_id); return AcquireResult::ALLOWED; } default: { DCHECK_OR_RETURN(false, AcquireResult::IN_USE); } @@ -154,7 +146,7 @@ AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource( bool ResourceAllocationManagerImpl::IsUserLocationValid( ModuleUid& module, application_manager::ApplicationSharedPtr app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto extension = RCHelpers::GetRCExtension(*app); DCHECK_OR_RETURN(extension, false); const auto user_location = extension->GetUserLocation(); @@ -166,15 +158,14 @@ bool ResourceAllocationManagerImpl::IsUserLocationValid( if (is_driver || user_location.IntersectionExists(module_service_area)) { return true; } - LOG4CXX_DEBUG(logger_, "User location is not valid"); + SDL_LOG_DEBUG("User location is not valid"); return false; } void ResourceAllocationManagerImpl::ReleaseModuleType( const std::string& module_type, const uint32_t application_id) { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, - "Release " << module_type << " " + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Release " << module_type << " " << " by " << application_id); Resources allocated_resources = GetAcquiredResources(application_id); for (const auto& resource : allocated_resources) { @@ -185,7 +176,7 @@ void ResourceAllocationManagerImpl::ReleaseModuleType( } void ResourceAllocationManagerImpl::ProcessApplicationPolicyUpdate() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); Apps app_list = RCRPCPlugin::GetRCApplications(app_mngr_); Apps::const_iterator app = app_list.begin(); @@ -200,8 +191,7 @@ void ResourceAllocationManagerImpl::ProcessApplicationPolicyUpdate() { &allowed_modules); std::sort(allowed_modules.begin(), allowed_modules.end()); - LOG4CXX_DEBUG(logger_, - "Acquired modules: " << acquired_modules.size() + SDL_LOG_DEBUG("Acquired modules: " << acquired_modules.size() << " , allowed modules: " << allowed_modules.size()); @@ -242,7 +232,7 @@ void ConstructOnRCStatusNotificationParams( using smart_objects::SmartObject; using smart_objects::SmartType_Array; using smart_objects::SmartType_Map; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto modules_inserter = [](SmartObject& result_modules) { return [&result_modules](const ModuleUid& module) { @@ -275,7 +265,7 @@ void ConstructOnRCStatusNotificationParams( smart_objects::SmartObjectSPtr ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToMobile( const application_manager::ApplicationSharedPtr app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using application_manager::MessageHelper; auto msg_to_mobile = MessageHelper::CreateNotification( mobile_apis::FunctionID::OnRCStatusID, app->app_id()); @@ -298,7 +288,7 @@ ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToMobile( smart_objects::SmartObjectSPtr ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToHmi( const application_manager::ApplicationSharedPtr app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using application_manager::MessageHelper; auto msg_to_hmi = MessageHelper::CreateHMINotification(hmi_apis::FunctionID::RC_OnRCStatus); @@ -314,7 +304,7 @@ ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToHmi( void ResourceAllocationManagerImpl::SendOnRCStatusNotifications( NotificationTrigger::eType event, application_manager::ApplicationSharedPtr application) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObjectSPtr msg_to_mobile; smart_objects::SmartObjectSPtr msg_to_hmi; if (NotificationTrigger::APP_REGISTRATION == event) { @@ -351,9 +341,8 @@ ResourceReleasedState::eType ResourceAllocationManagerImpl::ReleaseResource( const std::string& module_type, const std::string& module_id, const uint32_t application_id) { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, - "Release " << module_type << " " << module_id << " by " + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Release " << module_type << " " << module_id << " by " << application_id); return SetResourceFree(module_type, module_id, application_id); } @@ -362,35 +351,32 @@ void ResourceAllocationManagerImpl::SetResourceAcquired( const std::string& module_type, const std::string& module_id, const uint32_t app_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ModuleUid module(module_type, module_id); allocated_resources_[module] = app_id; } bool ResourceAllocationManagerImpl::IsResourceAlreadyAcquiredByApp( const ModuleUid& moduleUid, const uint32_t app_id) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto allocation = allocated_resources_.find(moduleUid); if (allocated_resources_.end() == allocation) { - LOG4CXX_DEBUG(logger_, - "Resource " << moduleUid.first + SDL_LOG_DEBUG("Resource " << moduleUid.first << " is not allocated for any application."); return false; } if (allocation->second != app_id) { - LOG4CXX_DEBUG(logger_, - "Resource " - << moduleUid.first - << " is already allocated by app:" << allocation->second - << ". Asquire has been asked for app:" << app_id); + SDL_LOG_DEBUG("Resource " + << moduleUid.first + << " is already allocated by app:" << allocation->second + << ". Acquire has been asked for app:" << app_id); return false; } - LOG4CXX_DEBUG(logger_, - "Resource " << moduleUid.first + SDL_LOG_DEBUG("Resource " << moduleUid.first << " is allocated by app:" << allocation->second); return true; @@ -404,26 +390,24 @@ ResourceReleasedState::eType ResourceAllocationManagerImpl::SetResourceFree( AllocatedResources::const_iterator allocation = allocated_resources_.find(module); if (allocated_resources_.end() == allocation) { - LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is not allocated."); + SDL_LOG_DEBUG("Resource " << module_type << " is not allocated."); return ResourceReleasedState::NOT_ALLOCATED; } if (app_id != allocation->second) { - LOG4CXX_ERROR(logger_, - "Resource " << module_type + SDL_LOG_ERROR("Resource " << module_type << " is allocated by different application " << allocation->second); return ResourceReleasedState::IS_ALLOCATED; } allocated_resources_.erase(allocation); - LOG4CXX_DEBUG( - logger_, - "Resource " << module_type << ":" << module_id << " is released."); + SDL_LOG_DEBUG("Resource " << module_type << ":" << module_id + << " is released."); return ResourceReleasedState::IS_RELEASED; } std::vector<ModuleUid> ResourceAllocationManagerImpl::GetAcquiredResources( const uint32_t application_id) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); Resources allocated_resources; AllocatedResources::const_iterator allocation = allocated_resources_.begin(); for (; allocated_resources_.end() != allocation; ++allocation) { @@ -432,8 +416,7 @@ std::vector<ModuleUid> ResourceAllocationManagerImpl::GetAcquiredResources( } } - LOG4CXX_DEBUG(logger_, - "Application " << application_id << " acquired " + SDL_LOG_DEBUG("Application " << application_id << " acquired " << allocated_resources.size() << " resource(s)."); @@ -442,15 +425,14 @@ std::vector<ModuleUid> ResourceAllocationManagerImpl::GetAcquiredResources( std::set<std::string> ResourceAllocationManagerImpl::GetAcquiredModuleTypes( const uint32_t application_id) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); Resources allocated_resources = GetAcquiredResources(application_id); std::set<std::string> acquired_module_types; for (const auto& resource : allocated_resources) { acquired_module_types.insert(resource.first); } - LOG4CXX_DEBUG(logger_, - "Application " << application_id << " acquired " + SDL_LOG_DEBUG("Application " << application_id << " acquired " << acquired_module_types.size() << " module type(s)."); @@ -462,9 +444,8 @@ void ResourceAllocationManagerImpl::SetResourceState( const std::string& module_id, const uint32_t app_id, const ResourceState::eType state) { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, - "Setting state for " << module_type << " by app_id " << app_id + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Setting state for " << module_type << " by app_id " << app_id << " to state " << state); ModuleUid module(module_type, module_id); { @@ -474,36 +455,33 @@ void ResourceAllocationManagerImpl::SetResourceState( const bool acquired = allocated_resources_.end() != allocated_it; if (acquired) { - LOG4CXX_DEBUG(logger_, - "Resource " << module_type << " is already acquired." + SDL_LOG_DEBUG("Resource " << module_type << " is already acquired." << " Owner application id is " << allocated_it->second << " Changing application id is " << app_id); } else { - LOG4CXX_DEBUG(logger_, - "Resource " << module_type << " is not acquired yet"); + SDL_LOG_DEBUG("Resource " << module_type << " is not acquired yet"); } } sync_primitives::AutoLock lock(resources_state_lock_); resources_state_[module] = state; - LOG4CXX_DEBUG(logger_, "Resource " << module_type << " got state " << state); + SDL_LOG_DEBUG("Resource " << module_type << " got state " << state); } bool ResourceAllocationManagerImpl::IsResourceFree( const std::string& module_type, const std::string& module_id) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ModuleUid module(module_type, module_id); sync_primitives::AutoLock lock(resources_state_lock_); const ResourcesState::const_iterator resource = resources_state_.find(module); if (resources_state_.end() == resource) { - LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is free."); + SDL_LOG_DEBUG("Resource " << module_type << " is free."); return true; } - LOG4CXX_DEBUG(logger_, - "Resource " << module_type << " state is " << resource->second); + SDL_LOG_DEBUG("Resource " << module_type << " state is " << resource->second); return ResourceState::FREE == resource->second; } @@ -526,7 +504,7 @@ void ResourceAllocationManagerImpl::ForceAcquireResource( const std::string& module_type, const std::string& module_id, const uint32_t app_id) { - LOG4CXX_DEBUG(logger_, "Force " << app_id << " acquiring " << module_type); + SDL_LOG_DEBUG("Force " << app_id << " acquiring " << module_type); sync_primitives::AutoLock lock(allocated_resources_lock_); SetResourceAcquired(module_type, module_id, app_id); } @@ -535,7 +513,7 @@ bool ResourceAllocationManagerImpl::IsModuleTypeRejected( const std::string& module_type, const std::string& module_id, const uint32_t app_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ModuleUid module(module_type, module_id); sync_primitives::AutoLock lock(rejected_resources_for_application_lock_); RejectedResources::iterator it = @@ -555,7 +533,7 @@ void ResourceAllocationManagerImpl::OnDriverDisallowed( const std::string& module_type, const std::string& module_id, const uint32_t app_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ModuleUid module(module_type, module_id); sync_primitives::AutoLock lock(rejected_resources_for_application_lock_); auto it = rejected_resources_for_application_.find(app_id); @@ -572,9 +550,8 @@ void ResourceAllocationManagerImpl::OnApplicationEvent( application_manager::plugin_manager::ApplicationEvent event, application_manager::ApplicationSharedPtr application) { using application_manager::plugin_manager::ApplicationEvent; - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, - "Event " << event << " came for " << application->app_id()); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Event " << event << " came for " << application->app_id()); if (ApplicationEvent::kApplicationExit == event || ApplicationEvent::kApplicationUnregistered == event) { @@ -594,8 +571,8 @@ void ResourceAllocationManagerImpl::OnApplicationEvent( void ResourceAllocationManagerImpl::OnPolicyEvent( application_manager::plugin_manager::PolicyEvent event) { using application_manager::plugin_manager::PolicyEvent; - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Event " << event); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Event " << event); if (PolicyEvent::kApplicationPolicyUpdated == event) { ProcessApplicationPolicyUpdate(); @@ -609,7 +586,7 @@ void ResourceAllocationManagerImpl::OnPolicyEvent( } void ResourceAllocationManagerImpl::ResetAllAllocations() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); { sync_primitives::AutoLock lock(resources_state_lock_); resources_state_.clear(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h index 9c770279ab..f707396f5e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h @@ -34,6 +34,7 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H #include "application_manager/command_factory.h" #include "application_manager/plugin_manager/rpc_plugin.h" +#include "utils/ilogger.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -74,6 +75,7 @@ class SDLRPCPlugin : public plugins::RPCPlugin { }; } // namespace sdl_rpc_plugin -extern "C" application_manager::plugin_manager::RPCPlugin* Create(); +extern "C" application_manager::plugin_manager::RPCPlugin* Create( + logger::Logger* logger_instances); extern "C" void Delete(application_manager::plugin_manager::RPCPlugin* data); #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc index c6d181bf57..35fb2204ac 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ActivateAppRequest::ActivateAppRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,11 +54,11 @@ ActivateAppRequest::ActivateAppRequest( policy_handle) {} ActivateAppRequest::~ActivateAppRequest() { - LOG4CXX_TRACE(logger_, "~ActivateAppRequest"); + SDL_LOG_TRACE("~ActivateAppRequest"); } void ActivateAppRequest::Run() { - LOG4CXX_TRACE(logger_, "enter " << correlation_id()); + SDL_LOG_TRACE("enter " << correlation_id()); uint32_t app_id = RequestToHMI::application_id(); application_manager_.set_application_id(correlation_id(), app_id); #ifdef ENABLE_LOG @@ -66,11 +68,11 @@ void ActivateAppRequest::Run() { static_cast<mobile_apis::HMILevel::eType>( (*message_)[strings::msg_params][strings::activate_app_hmi_level] .asInt()); - LOG4CXX_TRACE(logger_, "requested_hmi_level = " << requested_hmi_level); + SDL_LOG_TRACE("requested_hmi_level = " << requested_hmi_level); } #endif SendRequest(); - LOG4CXX_TRACE(logger_, "exit"); + SDL_LOG_TRACE("exit"); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc index b829ef711e..9615f83170 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ActivateAppResponse::ActivateAppResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,12 +55,12 @@ ActivateAppResponse::ActivateAppResponse( ActivateAppResponse::~ActivateAppResponse() {} void ActivateAppResponse::Run() { - LOG4CXX_TRACE(logger_, "enter"); + SDL_LOG_TRACE("enter"); event_engine::Event event( hmi_apis::FunctionID::BasicCommunication_ActivateApp); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); - LOG4CXX_TRACE(logger_, "exit"); + SDL_LOG_TRACE("exit"); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc index 93999f704d..8ddad0945c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AddStatisticsInfoNotification::AddStatisticsInfoNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ AddStatisticsInfoNotification::AddStatisticsInfoNotification( AddStatisticsInfoNotification::~AddStatisticsInfoNotification() {} void AddStatisticsInfoNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); int type = (*message_)[strings::msg_params][hmi_notification::statistic_type] .asInt(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc index 68c7896a7f..fdb2f454d5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AllowAllAppsRequest::AllowAllAppsRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ AllowAllAppsRequest::AllowAllAppsRequest( AllowAllAppsRequest::~AllowAllAppsRequest() {} void AllowAllAppsRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc index c2182f4853..be049aaea2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AllowAllAppsResponse::AllowAllAppsResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ AllowAllAppsResponse::AllowAllAppsResponse( AllowAllAppsResponse::~AllowAllAppsResponse() {} void AllowAllAppsResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); application_manager_.SetAllAppsAllowed( (*message_)[strings::msg_params][hmi_response::allowed].asBool()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc index 6b5af76fb1..32fb35b344 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AllowAppRequest::AllowAppRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ AllowAppRequest::AllowAppRequest( AllowAppRequest::~AllowAppRequest() {} void AllowAppRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc index c62645c6c0..458b7097e3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AllowAppResponse::AllowAppResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ AllowAppResponse::AllowAppResponse( AllowAppResponse::~AllowAppResponse() {} void AllowAppResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); uint32_t connection_key = (*message_)[strings::params][strings::connection_key].asInt(); @@ -61,7 +63,7 @@ void AllowAppResponse::Run() { ApplicationSharedPtr app = application_manager_.application(connection_key); if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } app->set_app_allowed( diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc index b021faefd8..f87f103b0f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc @@ -36,6 +36,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + BasicCommunicationCloseApplicationRequest:: BasicCommunicationCloseApplicationRequest( const application_manager::commands::MessageSharedPtr& message, @@ -53,7 +55,7 @@ BasicCommunicationCloseApplicationRequest:: ~BasicCommunicationCloseApplicationRequest() {} void BasicCommunicationCloseApplicationRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc index 2e56271cf2..74df410213 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc @@ -36,6 +36,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + BasicCommunicationCloseApplicationResponse:: BasicCommunicationCloseApplicationResponse( const application_manager::commands::MessageSharedPtr& message, @@ -53,7 +55,7 @@ BasicCommunicationCloseApplicationResponse:: ~BasicCommunicationCloseApplicationResponse() {} void BasicCommunicationCloseApplicationResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::BasicCommunication_CloseApplication); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc index 19c9fa91d8..a6e95f9f72 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + BasicCommunicationGetSystemTimeRequest::BasicCommunicationGetSystemTimeRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -50,7 +52,7 @@ BasicCommunicationGetSystemTimeRequest::BasicCommunicationGetSystemTimeRequest( policy_handler) {} void BasicCommunicationGetSystemTimeRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); application_manager_.protocol_handler().NotifyOnGetSystemTimeFailed(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc index e26753b3f2..1376376bb8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc @@ -33,7 +33,7 @@ #include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h" #include "utils/logger.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "Commands") +SDL_CREATE_LOG_VARIABLE("Commands") namespace sdl_rpc_plugin { using namespace application_manager; @@ -53,7 +53,7 @@ BasicCommunicationGetSystemTimeResponse:: policy_handler) {} void BasicCommunicationGetSystemTimeResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::BasicCommunication_GetSystemTime); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc index 361dc5fea6..52f8c4329f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAwakeSDLNotification::OnAwakeSDLNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ OnAwakeSDLNotification::OnAwakeSDLNotification( OnAwakeSDLNotification::~OnAwakeSDLNotification() {} void OnAwakeSDLNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!application_manager_.resume_controller().is_suspended()) { return; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc index 052a40a888..62c4a0ff3d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + BasicCommunicationSystemRequest::BasicCommunicationSystemRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ BasicCommunicationSystemRequest::BasicCommunicationSystemRequest( BasicCommunicationSystemRequest::~BasicCommunicationSystemRequest() {} void BasicCommunicationSystemRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc index 0b052de88d..06b31cb73d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + BasicCommunicationSystemResponse::BasicCommunicationSystemResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ BasicCommunicationSystemResponse::BasicCommunicationSystemResponse( BasicCommunicationSystemResponse::~BasicCommunicationSystemResponse() {} void BasicCommunicationSystemResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::BasicCommunication_SystemRequest); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_request.cc index 0dafa21e33..fddcc50a16 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_request.cc @@ -39,6 +39,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + BCGetAppPropertiesRequest::BCGetAppPropertiesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,15 +56,14 @@ BCGetAppPropertiesRequest::BCGetAppPropertiesRequest( void BCGetAppPropertiesRequest::FillAppProperties( const std::string& policy_app_id, smart_objects::SmartObject& out_properties) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); policy::AppProperties app_properties; const bool result = policy_handler_.GetAppProperties(policy_app_id, app_properties); if (!result) { - LOG4CXX_DEBUG( - logger_, + SDL_LOG_DEBUG( "Failed to get app parameters for policy_app_id: " << policy_app_id); return; } @@ -98,7 +99,7 @@ void BCGetAppPropertiesRequest::FillAppProperties( } void BCGetAppPropertiesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto& msg_params = (*message_)[strings::msg_params]; smart_objects::SmartObject response_params(smart_objects::SmartType_Map); @@ -111,9 +112,9 @@ void BCGetAppPropertiesRequest::Run() { response_params[strings::properties][0] = properties; } } else { - LOG4CXX_DEBUG(logger_, - "policyAppID was absent in request, all apps properties " - "will be returned."); + SDL_LOG_DEBUG( + "policyAppID was absent in request, all apps properties " + "will be returned."); const auto app_ids = policy_handler_.GetApplicationPolicyIDs(); int i = 0; for (auto& app_id : app_ids) { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_response.cc index 57949a949b..006cc536bf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_app_properties_response.cc @@ -40,6 +40,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + BCGetAppPropertiesResponse::BCGetAppPropertiesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ BCGetAppPropertiesResponse::BCGetAppPropertiesResponse( policy_handler) {} void BCGetAppPropertiesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToHMI(message_); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_request.cc index b735cd9bdf..a8a47d1fef 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_request.cc @@ -39,6 +39,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + BCGetFilePathRequest::BCGetFilePathRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ BCGetFilePathRequest::BCGetFilePathRequest( BCGetFilePathRequest::~BCGetFilePathRequest() {} void BCGetFilePathRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_response.cc index 58cda68a2b..f9d3fbe953 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_response.cc @@ -40,6 +40,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + BCGetFilePathResponse::BCGetFilePathResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ BCGetFilePathResponse::BCGetFilePathResponse( BCGetFilePathResponse::~BCGetFilePathResponse() {} void BCGetFilePathResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); application_manager::event_engine::Event event( hmi_apis::FunctionID::BasicCommunication_GetFilePath); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_set_app_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_set_app_properties_request.cc index a4c5d6b1b4..dd5ea3bb85 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_set_app_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_set_app_properties_request.cc @@ -40,6 +40,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + BCSetAppPropertiesRequest::BCSetAppPropertiesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ BCSetAppPropertiesRequest::BCSetAppPropertiesRequest( policy_handler) {} void BCSetAppPropertiesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto& properties = (*message_)[strings::msg_params][strings::properties]; @@ -81,9 +83,8 @@ void BCSetAppPropertiesRequest::Run() { application_manager_.GetRPCService().ManageHMICommand(notification); } if (is_new_app) { - LOG4CXX_ERROR(logger_, - "Message contains unknow policyAppId: " - << policy_app_id << ", PTU will be triggered"); + SDL_LOG_ERROR("Message contains unknow policyAppId: " + << policy_app_id << ", PTU will be triggered"); policy_handler_.OnLocalAppAdded(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_set_app_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_set_app_properties_response.cc index 928a17d0f8..a99e3d6a3e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_set_app_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_set_app_properties_response.cc @@ -41,6 +41,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + BCSetAppPropertiesResponse::BCSetAppPropertiesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ BCSetAppPropertiesResponse::BCSetAppPropertiesResponse( policy_handler) {} void BCSetAppPropertiesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToHMI(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc index c0d22dcb89..d9c7901c67 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ButtonGetCapabilitiesRequest::ButtonGetCapabilitiesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,13 +55,13 @@ ButtonGetCapabilitiesRequest::ButtonGetCapabilitiesRequest( ButtonGetCapabilitiesRequest::~ButtonGetCapabilitiesRequest() {} void ButtonGetCapabilitiesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void ButtonGetCapabilitiesRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::Buttons_GetCapabilities); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc index cc3a61a9df..20250af222 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ButtonGetCapabilitiesResponse::ButtonGetCapabilitiesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ ButtonGetCapabilitiesResponse::ButtonGetCapabilitiesResponse( ButtonGetCapabilitiesResponse::~ButtonGetCapabilitiesResponse() {} void ButtonGetCapabilitiesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const hmi_apis::Common_Result::eType code = static_cast<hmi_apis::Common_Result::eType>( (*message_)[strings::params][hmi_response::code].asInt()); @@ -62,7 +64,7 @@ void ButtonGetCapabilitiesResponse::Run() { hmi_apis::FunctionID::Buttons_GetCapabilities); if (hmi_apis::Common_Result::SUCCESS != code) { - LOG4CXX_ERROR(logger_, "Error is returned. Capabilities won't be updated."); + SDL_LOG_ERROR("Error is returned. Capabilities won't be updated."); return; } @@ -81,8 +83,7 @@ void ButtonGetCapabilitiesResponse::Run() { if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::buttons, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, - "Failed to save Buttons.GetCapabilities response to cache"); + SDL_LOG_ERROR("Failed to save Buttons.GetCapabilities response to cache"); } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc index 988794f668..b4b838b8dd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ClosePopupRequest::ClosePopupRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ ClosePopupRequest::ClosePopupRequest( ClosePopupRequest::~ClosePopupRequest() {} void ClosePopupRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc index 072e1960e9..76ed7a749a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ClosePopupResponse::ClosePopupResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ ClosePopupResponse::ClosePopupResponse( ClosePopupResponse::~ClosePopupResponse() {} void ClosePopupResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // TODO(VS): Process response from HMI } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc index 71782ef575..0bc9090bbe 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DecryptCertificateRequest::DecryptCertificateRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -50,7 +52,7 @@ DecryptCertificateRequest::DecryptCertificateRequest( policy_handle) {} void DecryptCertificateRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const uint32_t correlation_id = RequestToHMI::correlation_id(); const uint32_t app_id = RequestToHMI::application_id(); application_manager_.set_application_id(correlation_id, app_id); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc index cf2a4d092c..5c3bf9d0e2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DecryptCertificateResponse::DecryptCertificateResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ DecryptCertificateResponse::DecryptCertificateResponse( DecryptCertificateResponse::~DecryptCertificateResponse() {} void DecryptCertificateResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const hmi_apis::Common_Result::eType code = static_cast<hmi_apis::Common_Result::eType>( (*message_)[strings::params][hmi_response::code].asInt()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc index 7a505a46f3..1b42abd055 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetSystemInfoRequest::GetSystemInfoRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ GetSystemInfoRequest::GetSystemInfoRequest( GetSystemInfoRequest::~GetSystemInfoRequest() {} void GetSystemInfoRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); uint32_t correlation_id = RequestToHMI::correlation_id(); uint32_t app_id = RequestToHMI::application_id(); application_manager_.set_application_id(correlation_id, app_id); @@ -60,7 +62,7 @@ void GetSystemInfoRequest::Run() { } void GetSystemInfoRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateCachedCapabilities(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc index 7a7d015e21..77605b31c3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc @@ -37,6 +37,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetSystemInfoResponse::GetSystemInfoResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,14 +54,14 @@ GetSystemInfoResponse::GetSystemInfoResponse( GetSystemInfoResponse::~GetSystemInfoResponse() {} void GetSystemInfoResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto code = static_cast<hmi_apis::Common_Result::eType>( (*message_)[strings::params][hmi_response::code].asInt()); hmi_capabilities_.set_ccpu_version(policy_handler_.GetCCPUVersionFromPT()); if (hmi_apis::Common_Result::SUCCESS != code) { - LOG4CXX_WARN(logger_, "GetSystemError returns an error code " << code); + SDL_LOG_WARN("GetSystemError returns an error code " << code); hmi_capabilities_.UpdateCachedCapabilities(); policy_handler_.SetPreloadedPtFlag(false); return; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc index b8c61ca902..288d7c0927 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + MixingAudioSupportedRequest::MixingAudioSupportedRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ MixingAudioSupportedRequest::MixingAudioSupportedRequest( MixingAudioSupportedRequest::~MixingAudioSupportedRequest() {} void MixingAudioSupportedRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc index 089e56e598..e9dc69db2b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + MixingAudioSupportedResponse::MixingAudioSupportedResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ MixingAudioSupportedResponse::MixingAudioSupportedResponse( MixingAudioSupportedResponse::~MixingAudioSupportedResponse() {} void MixingAudioSupportedResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.set_attenuated_supported( (*message_)[strings::msg_params][hmi_response::attenuated_supported] diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc index 8390fea5bc..9010e32125 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviAlertManeuverRequest::NaviAlertManeuverRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ NaviAlertManeuverRequest::NaviAlertManeuverRequest( NaviAlertManeuverRequest::~NaviAlertManeuverRequest() {} void NaviAlertManeuverRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc index a1603f069d..40f4471586 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviAlertManeuverResponse::NaviAlertManeuverResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ NaviAlertManeuverResponse::NaviAlertManeuverResponse( NaviAlertManeuverResponse::~NaviAlertManeuverResponse() {} void NaviAlertManeuverResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::Navigation_AlertManeuver); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc index 47f2f2505e..b9860bcd02 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AudioStartStreamRequest::AudioStartStreamRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,13 +55,12 @@ AudioStartStreamRequest::AudioStartStreamRequest( policy_handle) , EventObserver(application_manager.event_dispatcher()) , retry_number_(0) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::pair<uint32_t, int32_t> stream_retry = application_manager_.get_settings().start_stream_retry_amount(); default_timeout_ = stream_retry.second; retry_number_ = stream_retry.first; - LOG4CXX_DEBUG(logger_, - "default_timeout_ = " << default_timeout_ + SDL_LOG_DEBUG("default_timeout_ = " << default_timeout_ << "; retry_number_ = " << retry_number_); } @@ -69,17 +70,16 @@ AudioStartStreamRequest::~AudioStartStreamRequest() { } void AudioStartStreamRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!app_mngr::commands::CheckAvailabilityHMIInterfaces( application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) { - LOG4CXX_INFO(logger_, "Interface Navi is not supported by system"); + SDL_LOG_INFO("Interface Navi is not supported by system"); return; } ApplicationSharedPtr app = application_manager_.application_by_hmi_app(application_id()); if (!app) { - LOG4CXX_ERROR(logger_, - "Application with hmi_app_id " << application_id() + SDL_LOG_ERROR("Application with hmi_app_id " << application_id() << " does not exist"); return; } @@ -92,33 +92,31 @@ void AudioStartStreamRequest::Run() { void AudioStartStreamRequest::on_event(const event_engine::Event& event) { using namespace protocol_handler; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application_by_hmi_app(application_id()); if (!app) { - LOG4CXX_ERROR(logger_, - "StartAudioStreamRequest aborted. Application not found"); + SDL_LOG_ERROR("StartAudioStreamRequest aborted. Application not found"); return; } const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { case hmi_apis::FunctionID::Navigation_StartAudioStream: { - LOG4CXX_DEBUG(logger_, "Received StartStream event"); + SDL_LOG_DEBUG("Received StartStream event"); const hmi_apis::Common_Result::eType code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); if (hmi_apis::Common_Result::SUCCESS == code) { - LOG4CXX_INFO(logger_, "StartAudioStream response SUCCESS"); + SDL_LOG_INFO("StartAudioStream response SUCCESS"); if (application_manager_.HMIStateAllowsStreaming(app->app_id(), ServiceType::kAudio)) { app->set_audio_streaming_approved(true); } else { - LOG4CXX_WARN( - logger_, + SDL_LOG_WARN( "StartAudioStreamRequest aborted. Application can not stream"); } application_manager_.TerminateRequest( @@ -126,25 +124,25 @@ void AudioStartStreamRequest::on_event(const event_engine::Event& event) { break; } if (hmi_apis::Common_Result::REJECTED == code) { - LOG4CXX_INFO(logger_, "StartAudioStream response REJECTED"); + SDL_LOG_INFO("StartAudioStream response REJECTED"); RetryStartSession(); break; } } default: { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SDL_LOG_ERROR("Received unknown event " << event.id()); return; } } } void AudioStartStreamRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); RetryStartSession(); } void AudioStartStreamRequest::RetryStartSession() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); application_manager_.TerminateRequest( connection_key(), correlation_id(), function_id()); @@ -152,20 +150,18 @@ void AudioStartStreamRequest::RetryStartSession() { ApplicationSharedPtr app = application_manager_.application_by_hmi_app(application_id()); if (!app) { - LOG4CXX_ERROR(logger_, - "StartAudioStreamRequest aborted. Application not found"); + SDL_LOG_ERROR("StartAudioStreamRequest aborted. Application not found"); return; } if (!app->audio_streaming_allowed()) { - LOG4CXX_WARN(logger_, "Audio streaming not allowed"); + SDL_LOG_WARN("Audio streaming not allowed"); return; } if (app->audio_streaming_approved()) { - LOG4CXX_INFO(logger_, - "AudioStartStream retry sequence stopped. " - << "SUCCESS received"); + SDL_LOG_INFO("AudioStartStream retry sequence stopped. " + << "SUCCESS received"); app->set_audio_stream_retry_number(0); return; } @@ -173,15 +169,13 @@ void AudioStartStreamRequest::RetryStartSession() { uint32_t curr_retry_number = app->audio_stream_retry_number(); if (curr_retry_number <= retry_number_) { - LOG4CXX_DEBUG( - logger_, - "Retry number " << curr_retry_number << " of " << retry_number_); + SDL_LOG_DEBUG("Retry number " << curr_retry_number << " of " + << retry_number_); MessageHelper::SendAudioStartStream(app->app_id(), application_manager_); app->set_audio_stream_retry_number(++curr_retry_number); } else { - LOG4CXX_DEBUG(logger_, - "Audio start stream retry sequence stopped. " - << "Attempts expired."); + SDL_LOG_DEBUG("Audio start stream retry sequence stopped. " + << "Attempts expired."); application_manager_.EndNaviServices(app->app_id()); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc index 61d49577f6..99ddceaa55 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AudioStartStreamResponse::AudioStartStreamResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ AudioStartStreamResponse::AudioStartStreamResponse( AudioStartStreamResponse::~AudioStartStreamResponse() {} void AudioStartStreamResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::Navigation_StartAudioStream); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc index a5d436f015..e20d0e1cb6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AudioStopStreamRequest::AudioStopStreamRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,10 +53,10 @@ AudioStopStreamRequest::AudioStopStreamRequest( AudioStopStreamRequest::~AudioStopStreamRequest() {} void AudioStopStreamRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!app_mngr::commands::CheckAvailabilityHMIInterfaces( application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) { - LOG4CXX_INFO(logger_, "Interface Navi is not supported by system"); + SDL_LOG_INFO("Interface Navi is not supported by system"); return; } SendRequest(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc index 98023ab571..1b2f2c476c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AudioStopStreamResponse::AudioStopStreamResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ AudioStopStreamResponse::AudioStopStreamResponse( AudioStopStreamResponse::~AudioStopStreamResponse() {} void AudioStopStreamResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc index edc4afe1e4..d0ef35c8fa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviGetWayPointsRequest::NaviGetWayPointsRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ NaviGetWayPointsRequest::NaviGetWayPointsRequest( NaviGetWayPointsRequest::~NaviGetWayPointsRequest() {} void NaviGetWayPointsRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc index 0f0b652d01..97ef0cae2b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviGetWayPointsResponse::NaviGetWayPointsResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ NaviGetWayPointsResponse::NaviGetWayPointsResponse( NaviGetWayPointsResponse::~NaviGetWayPointsResponse() {} void NaviGetWayPointsResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::Navigation_GetWayPoints); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc index 15e5b46b36..4caa307be3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviIsReadyRequest::NaviIsReadyRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,18 +55,18 @@ NaviIsReadyRequest::NaviIsReadyRequest( NaviIsReadyRequest::~NaviIsReadyRequest() {} void NaviIsReadyRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); subscribe_on_event(hmi_apis::FunctionID::Navigation_IsReady, correlation_id()); SendRequest(); } void NaviIsReadyRequest::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::Navigation_IsReady: { - LOG4CXX_DEBUG(logger_, "Received Navigation_IsReady event"); + SDL_LOG_DEBUG("Received Navigation_IsReady event"); unsubscribe_from_event(hmi_apis::FunctionID::Navigation_IsReady); const bool is_available = app_mngr::commands::ChangeInterfaceState( application_manager_, @@ -76,7 +78,7 @@ void NaviIsReadyRequest::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/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc index 073513eda9..2d7f2ec025 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviIsReadyResponse::NaviIsReadyResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ NaviIsReadyResponse::NaviIsReadyResponse( NaviIsReadyResponse::~NaviIsReadyResponse() {} void NaviIsReadyResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::Navigation_IsReady); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc index 360870e21c..db7e73144d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviSendLocationRequest::NaviSendLocationRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ NaviSendLocationRequest::NaviSendLocationRequest( NaviSendLocationRequest::~NaviSendLocationRequest() {} void NaviSendLocationRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc index dc60f2fbf0..d4d3ea0c2c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviSendLocationResponse::NaviSendLocationResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ NaviSendLocationResponse::NaviSendLocationResponse( NaviSendLocationResponse::~NaviSendLocationResponse() {} void NaviSendLocationResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::Navigation_SendLocation); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc index 764315f37f..e4fbdaa0d6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviSetVideoConfigRequest::NaviSetVideoConfigRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,19 +57,18 @@ NaviSetVideoConfigRequest::NaviSetVideoConfigRequest( NaviSetVideoConfigRequest::~NaviSetVideoConfigRequest() {} void NaviSetVideoConfigRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!app_mngr::commands::CheckAvailabilityHMIInterfaces( application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) { - LOG4CXX_WARN(logger_, "HMI interface Navigation is not supported"); + SDL_LOG_WARN("HMI interface Navigation is not supported"); return; } ApplicationSharedPtr app = application_manager_.application_by_hmi_app(application_id()); if (!app) { - LOG4CXX_ERROR( - logger_, - "Application with hmi_app_id " << application_id() << "does not exist"); + SDL_LOG_ERROR("Application with hmi_app_id " << application_id() + << " does not exist"); return; } @@ -77,13 +78,12 @@ void NaviSetVideoConfigRequest::Run() { } void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application_by_hmi_app(application_id()); if (!app) { - LOG4CXX_ERROR(logger_, - "Application is not found, abort NaviSetVideoConfigRequest"); + SDL_LOG_ERROR("Application is not found, abort NaviSetVideoConfigRequest"); return; } @@ -97,12 +97,11 @@ void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) { std::vector<std::string> rejected_params; if (code == hmi_apis::Common_Result::SUCCESS) { - LOG4CXX_DEBUG(logger_, "Received SetVideoConfig success response"); + SDL_LOG_DEBUG("Received SetVideoConfig success response"); result = true; } else { - LOG4CXX_DEBUG( - logger_, - "Received SetVideoConfig failure response (" << event.id() << ")"); + SDL_LOG_DEBUG("Received SetVideoConfig failure response (" << event.id() + << ")"); result = false; if (message[strings::msg_params].keyExists(strings::rejected_params)) { const smart_objects::SmartArray* list = @@ -128,18 +127,18 @@ void NaviSetVideoConfigRequest::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; } } void NaviSetVideoConfigRequest::onTimeOut() { - LOG4CXX_WARN(logger_, "Timed out while waiting for SetVideoConfig response"); + SDL_LOG_WARN("Timed out while waiting for SetVideoConfig response"); ApplicationSharedPtr app = application_manager_.application_by_hmi_app(application_id()); if (!app) { - LOG4CXX_ERROR(logger_, "Application is not found"); + SDL_LOG_ERROR("Application is not found"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc index e4a30c9da5..5291ef8adf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviSetVideoConfigResponse::NaviSetVideoConfigResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ NaviSetVideoConfigResponse::NaviSetVideoConfigResponse( NaviSetVideoConfigResponse::~NaviSetVideoConfigResponse() {} void NaviSetVideoConfigResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::Navigation_SetVideoConfig); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc index 95dd4561fc..ddfc7cc187 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviShowConstantTBTRequest::NaviShowConstantTBTRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ NaviShowConstantTBTRequest::NaviShowConstantTBTRequest( NaviShowConstantTBTRequest::~NaviShowConstantTBTRequest() {} void NaviShowConstantTBTRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc index f73099d29a..869b76863d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviShowConstantTBTResponse::NaviShowConstantTBTResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ NaviShowConstantTBTResponse::NaviShowConstantTBTResponse( NaviShowConstantTBTResponse::~NaviShowConstantTBTResponse() {} void NaviShowConstantTBTResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::Navigation_ShowConstantTBT); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc index 00974085c3..d0f95ee385 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviStartStreamRequest::NaviStartStreamRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,13 +55,12 @@ NaviStartStreamRequest::NaviStartStreamRequest( policy_handle) , EventObserver(application_manager.event_dispatcher()) , retry_number_(0) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::pair<uint32_t, int32_t> stream_retry = application_manager_.get_settings().start_stream_retry_amount(); default_timeout_ = stream_retry.second; retry_number_ = stream_retry.first; - LOG4CXX_DEBUG(logger_, - "default_timeout_ = " << default_timeout_ + SDL_LOG_DEBUG("default_timeout_ = " << default_timeout_ << "; retry_number_ = " << retry_number_); } @@ -71,18 +72,17 @@ NaviStartStreamRequest::~NaviStartStreamRequest() { } void NaviStartStreamRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!app_mngr::commands::CheckAvailabilityHMIInterfaces( application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) { - LOG4CXX_INFO(logger_, "Interface Navi is not supported by system"); + SDL_LOG_INFO("Interface Navi is not supported by system"); return; } ApplicationSharedPtr app = application_manager_.application_by_hmi_app(application_id()); if (!app) { - LOG4CXX_ERROR( - logger_, - "Application with hmi_app_id " << application_id() << "does not exist"); + SDL_LOG_ERROR("Application with hmi_app_id " << application_id() + << " does not exist"); return; } SetAllowedToTerminate(false); @@ -94,33 +94,31 @@ void NaviStartStreamRequest::Run() { void NaviStartStreamRequest::on_event(const event_engine::Event& event) { using namespace protocol_handler; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application_by_hmi_app(application_id()); if (!app) { - LOG4CXX_ERROR(logger_, - "NaviStartStreamRequest aborted. Application not found"); + SDL_LOG_ERROR("NaviStartStreamRequest aborted. Application not found"); return; } const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { case hmi_apis::FunctionID::Navigation_StartStream: { - LOG4CXX_DEBUG(logger_, "Received StartStream event"); + SDL_LOG_DEBUG("Received StartStream event"); const hmi_apis::Common_Result::eType code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); if (hmi_apis::Common_Result::SUCCESS == code) { - LOG4CXX_INFO(logger_, "NaviStartStreamResponse SUCCESS"); + SDL_LOG_INFO("NaviStartStreamResponse SUCCESS"); if (application_manager_.HMIStateAllowsStreaming( app->app_id(), ServiceType::kMobileNav)) { app->set_video_streaming_approved(true); } else { - LOG4CXX_DEBUG( - logger_, + SDL_LOG_DEBUG( "NaviStartStreamRequest aborted. Application can not stream"); } application_manager_.TerminateRequest( @@ -128,25 +126,25 @@ void NaviStartStreamRequest::on_event(const event_engine::Event& event) { break; } if (hmi_apis::Common_Result::REJECTED == code) { - LOG4CXX_INFO(logger_, "StartStream response REJECTED "); + SDL_LOG_INFO("StartStream response REJECTED"); RetryStartSession(); break; } } default: { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SDL_LOG_ERROR("Received unknown event " << event.id()); return; } } } void NaviStartStreamRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); RetryStartSession(); } void NaviStartStreamRequest::RetryStartSession() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); application_manager_.TerminateRequest( connection_key(), correlation_id(), function_id()); @@ -154,20 +152,18 @@ void NaviStartStreamRequest::RetryStartSession() { ApplicationSharedPtr app = application_manager_.application_by_hmi_app(application_id()); if (!app) { - LOG4CXX_ERROR(logger_, - "NaviStartStreamRequest aborted. Application not found"); + SDL_LOG_ERROR("NaviStartStreamRequest aborted. Application not found"); return; } if (!app->video_streaming_allowed()) { - LOG4CXX_WARN(logger_, "Video streaming not allowed"); + SDL_LOG_WARN("Video streaming not allowed"); return; } if (app->video_streaming_approved()) { - LOG4CXX_INFO(logger_, - "NaviStartStream retry sequence stopped. " - << "SUCCESS received"); + SDL_LOG_INFO("NaviStartStream retry sequence stopped. " + << "SUCCESS received"); app->set_video_stream_retry_number(0); return; } @@ -175,15 +171,13 @@ void NaviStartStreamRequest::RetryStartSession() { uint32_t curr_retry_number = app->video_stream_retry_number(); if (curr_retry_number <= retry_number_) { - LOG4CXX_DEBUG( - logger_, - "Retry number " << curr_retry_number << " of " << retry_number_); + SDL_LOG_DEBUG("Retry number " << curr_retry_number << " of " + << retry_number_); MessageHelper::SendNaviStartStream(app->app_id(), application_manager_); app->set_video_stream_retry_number(++curr_retry_number); } else { - LOG4CXX_DEBUG(logger_, - "NaviStartStream retry sequence stopped. " - << "Attempts expired"); + SDL_LOG_DEBUG("NaviStartStream retry sequence stopped. " + << "Attempts expired"); application_manager_.EndNaviServices(app->app_id()); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc index eafd81148a..a6595f1b8a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviStartStreamResponse::NaviStartStreamResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ NaviStartStreamResponse::NaviStartStreamResponse( NaviStartStreamResponse::~NaviStartStreamResponse() {} void NaviStartStreamResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::Navigation_StartStream); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc index ad09b0aee1..c86803413b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviStopStreamRequest::NaviStopStreamRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,10 +53,10 @@ NaviStopStreamRequest::NaviStopStreamRequest( NaviStopStreamRequest::~NaviStopStreamRequest() {} void NaviStopStreamRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!app_mngr::commands::CheckAvailabilityHMIInterfaces( application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) { - LOG4CXX_INFO(logger_, "Interface Navi is not supported by system"); + SDL_LOG_INFO("Interface Navi is not supported by system"); return; } SendRequest(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc index ff8c0bddff..3c12c527d8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviStopStreamResponse::NaviStopStreamResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ NaviStopStreamResponse::NaviStopStreamResponse( NaviStopStreamResponse::~NaviStopStreamResponse() {} void NaviStopStreamResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc index ba29f552b7..c08998ddf3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviSubscribeWayPointsRequest::NaviSubscribeWayPointsRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ NaviSubscribeWayPointsRequest::NaviSubscribeWayPointsRequest( NaviSubscribeWayPointsRequest::~NaviSubscribeWayPointsRequest() {} void NaviSubscribeWayPointsRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc index ddf8f75e58..37b4e8bbd3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviSubscribeWayPointsResponse::NaviSubscribeWayPointsResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ NaviSubscribeWayPointsResponse::NaviSubscribeWayPointsResponse( NaviSubscribeWayPointsResponse::~NaviSubscribeWayPointsResponse() {} void NaviSubscribeWayPointsResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::Navigation_SubscribeWayPoints); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc index d3c998cfdf..e3a690a971 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviUnsubscribeWayPointsRequest::NaviUnsubscribeWayPointsRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ NaviUnsubscribeWayPointsRequest::NaviUnsubscribeWayPointsRequest( NaviUnsubscribeWayPointsRequest::~NaviUnsubscribeWayPointsRequest() {} void NaviUnsubscribeWayPointsRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc index beed29e1e2..b84d89e658 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviUnsubscribeWayPointsResponse::NaviUnsubscribeWayPointsResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ NaviUnsubscribeWayPointsResponse::NaviUnsubscribeWayPointsResponse( NaviUnsubscribeWayPointsResponse::~NaviUnsubscribeWayPointsResponse() {} void NaviUnsubscribeWayPointsResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc index a8a258b1c0..91c764b5b4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviUpdateTurnListRequest::NaviUpdateTurnListRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ NaviUpdateTurnListRequest::NaviUpdateTurnListRequest( NaviUpdateTurnListRequest::~NaviUpdateTurnListRequest() {} void NaviUpdateTurnListRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc index a2f737df38..033c7f1383 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + NaviUpdateTurnListResponse::NaviUpdateTurnListResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ NaviUpdateTurnListResponse::NaviUpdateTurnListResponse( NaviUpdateTurnListResponse::~NaviUpdateTurnListResponse() {} void NaviUpdateTurnListResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc index 204cc7d347..985056e788 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAllowSDLFunctionalityNotification::OnAllowSDLFunctionalityNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ OnAllowSDLFunctionalityNotification::OnAllowSDLFunctionalityNotification( OnAllowSDLFunctionalityNotification::~OnAllowSDLFunctionalityNotification() {} void OnAllowSDLFunctionalityNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::string device_id; if ((*message_)[strings::msg_params].keyExists("device")) { device_id = (*message_)[strings::msg_params]["device"]["id"].asString(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc index e882020f8b..144c184e82 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAppActivatedNotification::OnAppActivatedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ OnAppActivatedNotification::OnAppActivatedNotification( OnAppActivatedNotification::~OnAppActivatedNotification() {} void OnAppActivatedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::BasicCommunication_OnAppActivated); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc index 18b796eaa8..81b07ed6f2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc @@ -42,6 +42,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAppDeactivatedNotification::OnAppDeactivatedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,7 +59,7 @@ OnAppDeactivatedNotification::OnAppDeactivatedNotification( OnAppDeactivatedNotification::~OnAppDeactivatedNotification() {} void OnAppDeactivatedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc index a1eb412c66..801e74eedd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAppPermissionChangedNotification::OnAppPermissionChangedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnAppPermissionChangedNotification::OnAppPermissionChangedNotification( OnAppPermissionChangedNotification::~OnAppPermissionChangedNotification() {} void OnAppPermissionChangedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc index 0033b392d2..37552e003a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc @@ -112,6 +112,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAppPermissionConsentNotification::OnAppPermissionConsentNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -127,7 +129,7 @@ OnAppPermissionConsentNotification::OnAppPermissionConsentNotification( OnAppPermissionConsentNotification::~OnAppPermissionConsentNotification() {} void OnAppPermissionConsentNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; uint32_t connection_key = 0; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_properties_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_properties_change_notification.cc index f1fa703bbb..d31d8436f7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_properties_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_properties_change_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAppPropertiesChangeNotification::OnAppPropertiesChangeNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -50,7 +52,7 @@ OnAppPropertiesChangeNotification::OnAppPropertiesChangeNotification( policy_handle) {} void OnAppPropertiesChangeNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc index 51c3125921..382b402383 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAppRegisteredNotification::OnAppRegisteredNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnAppRegisteredNotification::OnAppRegisteredNotification( OnAppRegisteredNotification::~OnAppRegisteredNotification() {} void OnAppRegisteredNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // SDL must notify system about app registration before any dependent actions // will be started SendNotification(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc index 07aadada81..4ff985cdf0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAppUnregisteredNotification::OnAppUnregisteredNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,13 +56,13 @@ OnAppUnregisteredNotification::OnAppUnregisteredNotification( OnAppUnregisteredNotification::~OnAppUnregisteredNotification() {} bool OnAppUnregisteredNotification::Init() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Replacement of hmi id is skipped."); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Replacement of hmi id is skipped."); return true; } void OnAppUnregisteredNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // sending event for delete VRCommand on PerformInteraction event_engine::Event event( diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc index d9c1120409..d72fb1244e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAudioDataStreamingNotification::OnAudioDataStreamingNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnAudioDataStreamingNotification::OnAudioDataStreamingNotification( OnAudioDataStreamingNotification::~OnAudioDataStreamingNotification() {} void OnAudioDataStreamingNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc index 1a104c0fa1..9caec22bd2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc @@ -42,6 +42,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnBCSystemCapabilityUpdatedNotification:: OnBCSystemCapabilityUpdatedNotification( const application_manager::commands::MessageSharedPtr& message, @@ -59,10 +61,10 @@ OnBCSystemCapabilityUpdatedNotification:: ~OnBCSystemCapabilityUpdatedNotification() {} void OnBCSystemCapabilityUpdatedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, - "Sending BasicCommunication.OnSystemCapabilityUpdated " - "Notification to HMI"); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG( + "Sending BasicCommunication.OnSystemCapabilityUpdated " + "Notification to HMI"); smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; @@ -150,9 +152,8 @@ void OnBCSystemCapabilityUpdatedNotification::Run() { app_services->end(), matching_service_predicate); if (it != app_services->end()) { - LOG4CXX_DEBUG( - logger_, - "Replacing updated record with service_id " << service_id); + SDL_LOG_DEBUG("Replacing updated record with service_id " + << service_id); app_services->erase(it); } app_services->push_back(updated_capabilities[i]); @@ -163,7 +164,7 @@ void OnBCSystemCapabilityUpdatedNotification::Run() { } case mobile_apis::SystemCapabilityType::DISPLAYS: { if (!hmi_capabilities_.system_display_capabilities()) { - LOG4CXX_INFO(logger_, "system_display_capabilities are not available"); + SDL_LOG_INFO("system_display_capabilities are not available"); return; } msg_params[strings::system_capability][strings::display_capabilities] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.cc index f32aef1102..948a4fd418 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification_from_hmi.cc @@ -42,6 +42,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnBCSystemCapabilityUpdatedNotificationFromHMI:: OnBCSystemCapabilityUpdatedNotificationFromHMI( const application_manager::commands::MessageSharedPtr& message, @@ -63,10 +65,10 @@ OnBCSystemCapabilityUpdatedNotificationFromHMI:: OnBCSystemCapabilityUpdatedNotificationFromHMI:: ProcessSystemDisplayCapabilities( const smart_objects::SmartObject& display_capabilities) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!(*message_)[strings::msg_params].keyExists(strings::app_id)) { - LOG4CXX_DEBUG(logger_, "Updating general display capabilities"); + SDL_LOG_DEBUG("Updating general display capabilities"); hmi_capabilities_.set_system_display_capabilities(display_capabilities); return ProcessSystemDisplayCapabilitiesResult::SUCCESS; } @@ -75,12 +77,11 @@ OnBCSystemCapabilityUpdatedNotificationFromHMI:: (*message_)[strings::msg_params][strings::app_id].asUInt(); auto app = application_manager_.application(app_id); if (!app) { - LOG4CXX_ERROR(logger_, - "Application with app_id " << app_id << " is not registered"); + SDL_LOG_ERROR("Application with app_id " << app_id << " is not registered"); return ProcessSystemDisplayCapabilitiesResult::FAIL; } - LOG4CXX_DEBUG(logger_, "Updating display capabilities for app " << app_id); + SDL_LOG_DEBUG("Updating display capabilities for app " << app_id); app->set_display_capabilities(display_capabilities); // Remove app_id from notification to mobile @@ -88,7 +89,7 @@ OnBCSystemCapabilityUpdatedNotificationFromHMI:: (*message_)[strings::msg_params][strings::app_id]; (*message_)[strings::msg_params].erase(strings::app_id); if (app->is_resuming() && app->is_app_data_resumption_allowed()) { - LOG4CXX_DEBUG(logger_, "Application is resuming"); + SDL_LOG_DEBUG("Application is resuming"); app->display_capabilities_builder().UpdateDisplayCapabilities( display_capabilities); return ProcessSystemDisplayCapabilitiesResult::CAPABILITIES_CACHED; @@ -98,7 +99,7 @@ OnBCSystemCapabilityUpdatedNotificationFromHMI:: } void OnBCSystemCapabilityUpdatedNotificationFromHMI::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // Prepare SmartObject for mobile factory (*message_)[strings::params][strings::function_id] = static_cast<int32_t>( @@ -113,15 +114,13 @@ void OnBCSystemCapabilityUpdatedNotificationFromHMI::Run() { const auto result = ProcessSystemDisplayCapabilities( system_capability[strings::display_capabilities]); if (ProcessSystemDisplayCapabilitiesResult::FAIL == result) { - LOG4CXX_ERROR( - logger_, + SDL_LOG_ERROR( "Failed to process display capabilities. Notification will " "be ignored"); return; } else if (ProcessSystemDisplayCapabilitiesResult:: CAPABILITIES_CACHED == result) { - LOG4CXX_TRACE(logger_, - "Capabilities are being cached for resuming app"); + SDL_LOG_TRACE("Capabilities are being cached for resuming app"); return; } } @@ -129,7 +128,7 @@ void OnBCSystemCapabilityUpdatedNotificationFromHMI::Run() { } case mobile_apis::SystemCapabilityType::REMOTE_CONTROL: { if (system_capability.keyExists(strings::rc_capability)) { - LOG4CXX_DEBUG(logger_, "Updating RC Capabilities"); + SDL_LOG_DEBUG("Updating RC Capabilities"); hmi_capabilities_.set_rc_capability( system_capability[strings::rc_capability]); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc index f25e6202cd..f6911637f9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc @@ -42,6 +42,8 @@ namespace commands { namespace hmi { +SDL_CREATE_LOG_VARIABLE("Commands") + OnButtonEventNotification::OnButtonEventNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ OnButtonEventNotification::OnButtonEventNotification( policy_handle) {} void OnButtonEventNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::function_id] = static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc index fee6b1b485..db2d81ccd1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc @@ -43,6 +43,8 @@ namespace commands { namespace hmi { +SDL_CREATE_LOG_VARIABLE("Commands") + OnButtonPressNotification::OnButtonPressNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ OnButtonPressNotification::OnButtonPressNotification( policy_handle) {} void OnButtonPressNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::Buttons_OnButtonPress); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc index 4ac752d6c5..c8d36407b8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc @@ -39,6 +39,8 @@ namespace commands { namespace hmi { +SDL_CREATE_LOG_VARIABLE("Commands") + OnButtonSubscriptionNotification::OnButtonSubscriptionNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ OnButtonSubscriptionNotification::OnButtonSubscriptionNotification( OnButtonSubscriptionNotification::~OnButtonSubscriptionNotification() {} void OnButtonSubscriptionNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc index f27c1fe5e5..9938c26192 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnDeviceChosenNotification::OnDeviceChosenNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnDeviceChosenNotification::OnDeviceChosenNotification( OnDeviceChosenNotification::~OnDeviceChosenNotification() {} void OnDeviceChosenNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if ((*message_)[strings::msg_params].keyExists(strings::device_info)) { application_manager_.ConnectToDevice( diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc index 129ba8c9ba..a6619c579c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc @@ -80,6 +80,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnDeviceStateChangedNotification::OnDeviceStateChangedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -95,7 +97,7 @@ OnDeviceStateChangedNotification::OnDeviceStateChangedNotification( OnDeviceStateChangedNotification::~OnDeviceStateChangedNotification() {} void OnDeviceStateChangedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if ((*message_)[strings::msg_params]["deviceState"] == hmi_apis::Common_DeviceState::UNPAIRED) { @@ -110,11 +112,11 @@ void OnDeviceStateChangedNotification::Run() { } } else { // Policy uses hashed MAC address as device_id - LOG4CXX_DEBUG(logger_, "Device_id from HMI: " << device_id); + SDL_LOG_DEBUG("Device_id from HMI: " << device_id); std::string bt_mac = convert_to_bt_mac(device_id); - LOG4CXX_DEBUG(logger_, "Device_id as BT MAC: " << bt_mac); + SDL_LOG_DEBUG("Device_id as BT MAC: " << bt_mac); device_id = encryption::MakeHash(bt_mac); - LOG4CXX_DEBUG(logger_, "Device_id hashed as BT MAC : " << device_id); + SDL_LOG_DEBUG("Device_id hashed as BT MAC : " << device_id); } policy_handler_.RemoveDevice(device_id); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc index a743c58672..f701713d96 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc @@ -124,6 +124,8 @@ struct OnDriverDistractionProcessor { }; } // namespace +SDL_CREATE_LOG_VARIABLE("Commands") + OnDriverDistractionNotification::OnDriverDistractionNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -139,7 +141,7 @@ OnDriverDistractionNotification::OnDriverDistractionNotification( OnDriverDistractionNotification::~OnDriverDistractionNotification() {} void OnDriverDistractionNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto state = static_cast<hmi_apis::Common_DriverDistractionState::eType>( (*message_)[strings::msg_params][hmi_notification::state].asInt()); @@ -147,7 +149,7 @@ void OnDriverDistractionNotification::Run() { auto on_driver_distraction = std::make_shared<smart_objects::SmartObject>(); if (!on_driver_distraction) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } (*on_driver_distraction)[strings::params][strings::function_id] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc index f6ea22ae34..13e76979a4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnEventChangedNotification::OnEventChangedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnEventChangedNotification::OnEventChangedNotification( OnEventChangedNotification::~OnEventChangedNotification() {} void OnEventChangedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event( hmi_apis::FunctionID::BasicCommunication_OnEventChanged); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc index 4c168f9eff..079e4f3d10 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc @@ -46,6 +46,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnExitAllApplicationsNotification::OnExitAllApplicationsNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -61,12 +63,12 @@ OnExitAllApplicationsNotification::OnExitAllApplicationsNotification( OnExitAllApplicationsNotification::~OnExitAllApplicationsNotification() {} void OnExitAllApplicationsNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const hmi_apis::Common_ApplicationsCloseReason::eType reason = static_cast<hmi_apis::Common_ApplicationsCloseReason::eType>( (*message_)[strings::msg_params][hmi_request::reason].asInt()); - LOG4CXX_DEBUG(logger_, "Reason " << reason); + SDL_LOG_DEBUG("Reason " << reason); mobile_api::AppInterfaceUnregisteredReason::eType mob_reason = mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM; @@ -90,7 +92,7 @@ void OnExitAllApplicationsNotification::Run() { return; } default: { - LOG4CXX_ERROR(logger_, "Unknown Application close reason" << reason); + SDL_LOG_ERROR("Unknown Application close reason" << reason); return; } } @@ -106,7 +108,7 @@ void OnExitAllApplicationsNotification::Run() { } void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObjectSPtr message = std::make_shared<smart_objects::SmartObject>( diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc index 34365c12e5..2b95d2e3e8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc @@ -44,6 +44,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnExitApplicationNotification::OnExitApplicationNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -59,7 +61,7 @@ OnExitApplicationNotification::OnExitApplicationNotification( OnExitApplicationNotification::~OnExitApplicationNotification() {} void OnExitApplicationNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace mobile_apis; using namespace hmi_apis; @@ -68,7 +70,7 @@ void OnExitApplicationNotification::Run() { ApplicationSharedPtr app_impl = application_manager_.application(app_id); if (app_impl.use_count() == 0) { - LOG4CXX_ERROR(logger_, "Application does not exist"); + SDL_LOG_ERROR("Application does not exist"); return; } @@ -122,7 +124,7 @@ void OnExitApplicationNotification::Run() { } default: { - LOG4CXX_WARN(logger_, "Unhandled reason"); + SDL_LOG_WARN("Unhandled reason"); return; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc index e1f0e2b104..d96f0498a5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnFileRemovedNotification::OnFileRemovedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnFileRemovedNotification::OnFileRemovedNotification( OnFileRemovedNotification::~OnFileRemovedNotification() {} void OnFileRemovedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc index 2e8f15387f..5f03d5ffa0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnFindApplications::OnFindApplications( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnFindApplications::OnFindApplications( OnFindApplications::~OnFindApplications() {} void OnFindApplications::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // TODO(PV): add UpdateAppsOnDevice to ApplicationManager } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc index 1e8da19c0a..2af2d1c2d6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnIgnitionCycleOverNotification::OnIgnitionCycleOverNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ OnIgnitionCycleOverNotification::OnIgnitionCycleOverNotification( OnIgnitionCycleOverNotification::~OnIgnitionCycleOverNotification() {} void OnIgnitionCycleOverNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); policy_handler_.OnIgnitionCycleOver(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc index f611b81764..01de5ccb06 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnNaviTBTClientStateNotification::OnNaviTBTClientStateNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnNaviTBTClientStateNotification::OnNaviTBTClientStateNotification( OnNaviTBTClientStateNotification::~OnNaviTBTClientStateNotification() {} void OnNaviTBTClientStateNotification::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/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc index 2a1a9c29fb..2440e918b7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnNaviWayPointChangeNotification::OnNaviWayPointChangeNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& app_man, @@ -49,7 +51,7 @@ OnNaviWayPointChangeNotification::OnNaviWayPointChangeNotification( OnNaviWayPointChangeNotification::~OnNaviWayPointChangeNotification() {} void OnNaviWayPointChangeNotification::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/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc index a0e75371b5..b883ac5c16 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc @@ -38,6 +38,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnPolicyUpdate::OnPolicyUpdate( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnPolicyUpdate::OnPolicyUpdate( OnPolicyUpdate::~OnPolicyUpdate() {} void OnPolicyUpdate::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); policy_handler_.OnPTExchangeNeeded(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc index 441e36a385..9349bc326d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnPutFileNotification::OnPutFileNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnPutFileNotification::OnPutFileNotification( OnPutFileNotification::~OnPutFileNotification() {} void OnPutFileNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc index c9270fd80b..ef92c28ba4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnReadyNotification::OnReadyNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnReadyNotification::OnReadyNotification( OnReadyNotification::~OnReadyNotification() {} void OnReadyNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); application_manager_.OnHMIReady(); event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnReady); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc index b2c9151b40..2f5901c9e2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnReceivedPolicyUpdate::OnReceivedPolicyUpdate( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,20 +58,20 @@ OnReceivedPolicyUpdate::OnReceivedPolicyUpdate( OnReceivedPolicyUpdate::~OnReceivedPolicyUpdate() {} void OnReceivedPolicyUpdate::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); #if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE) const std::string& file_path = (*message_)[strings::msg_params][hmi_notification::policyfile].asString(); policy::BinaryMessage file_content; if (!file_system::ReadBinaryFile(file_path, file_content)) { - LOG4CXX_ERROR(logger_, "Failed to read Update file."); + SDL_LOG_ERROR("Failed to read Update file."); return; } policy_handler_.ReceiveMessageFromSDK(file_path, file_content); #else - LOG4CXX_WARN(logger_, - "This RPC is part of extended policy flow." - "Please re-build with extended policy mode enabled."); + SDL_LOG_WARN( + "This RPC is part of extended policy flow. " + "Please re-build with extended policy mode enabled."); #endif } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc index dbef717539..e05c5860db 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnRecordStartdNotification::OnRecordStartdNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnRecordStartdNotification::OnRecordStartdNotification( OnRecordStartdNotification::~OnRecordStartdNotification() {} void OnRecordStartdNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc index 11d549655e..a56a6a26e1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnResumeAudioSourceNotification::OnResumeAudioSourceNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnResumeAudioSourceNotification::OnResumeAudioSourceNotification( OnResumeAudioSourceNotification::~OnResumeAudioSourceNotification() {} void OnResumeAudioSourceNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc index d0c584c66c..90a6cdf1ce 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnSDLCloseNotification::OnSDLCloseNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnSDLCloseNotification::OnSDLCloseNotification( OnSDLCloseNotification::~OnSDLCloseNotification() {} void OnSDLCloseNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc index 314a9e8f71..0774414222 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnSDLConsentNeededNotification::OnSDLConsentNeededNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnSDLConsentNeededNotification::OnSDLConsentNeededNotification( OnSDLConsentNeededNotification::~OnSDLConsentNeededNotification() {} void OnSDLConsentNeededNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc index 5db38d070b..efa880f484 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnSDLPersistenceCompleteNotification::OnSDLPersistenceCompleteNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnSDLPersistenceCompleteNotification::OnSDLPersistenceCompleteNotification( OnSDLPersistenceCompleteNotification::~OnSDLPersistenceCompleteNotification() {} void OnSDLPersistenceCompleteNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_service_update_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_service_update_notification.cc index de03b75214..c1f8c337bb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_service_update_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_service_update_notification.cc @@ -39,6 +39,8 @@ namespace commands { namespace hmi { +SDL_CREATE_LOG_VARIABLE("Commands") + OnServiceUpdateNotification::OnServiceUpdateNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ OnServiceUpdateNotification::OnServiceUpdateNotification( OnServiceUpdateNotification::~OnServiceUpdateNotification() {} void OnServiceUpdateNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc index 035def10e0..5e86618b31 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnStartDeviceDiscovery::OnStartDeviceDiscovery( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnStartDeviceDiscovery::OnStartDeviceDiscovery( OnStartDeviceDiscovery::~OnStartDeviceDiscovery() {} void OnStartDeviceDiscovery::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); application_manager_.StartDevicesDiscovery(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc index 5ee2ede198..4a2e310151 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnStatusUpdateNotification::OnStatusUpdateNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnStatusUpdateNotification::OnStatusUpdateNotification( OnStatusUpdateNotification::~OnStatusUpdateNotification() {} void OnStatusUpdateNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc index bf52492ae1..c86ef48225 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc @@ -40,6 +40,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnSystemContextNotification::OnSystemContextNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ OnSystemContextNotification::OnSystemContextNotification( OnSystemContextNotification::~OnSystemContextNotification() {} void OnSystemContextNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); mobile_api::SystemContext::eType system_context = static_cast<mobile_api::SystemContext::eType>( @@ -93,7 +95,7 @@ void OnSystemContextNotification::Run() { application_manager_.state_controller().SetRegularState( app, window_id, system_context); } else { - LOG4CXX_ERROR(logger_, "Application does not exist"); + SDL_LOG_ERROR("Application does not exist"); } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc index 9b8523e882..1f0d02ac83 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnSystemErrorNotification::OnSystemErrorNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ OnSystemErrorNotification::OnSystemErrorNotification( OnSystemErrorNotification::~OnSystemErrorNotification() {} void OnSystemErrorNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const int code = (*message_)[strings::msg_params][hmi_notification::error].asInt(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc index 171c144055..6a3b814d05 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnSystemInfoChangedNotification::OnSystemInfoChangedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ OnSystemInfoChangedNotification::OnSystemInfoChangedNotification( OnSystemInfoChangedNotification::~OnSystemInfoChangedNotification() {} void OnSystemInfoChangedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); uint32_t lang_code = (*message_)[strings::msg_params][strings::language].asUInt(); const std::string language = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc index 4f83e3e653..b75081e30f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc @@ -48,6 +48,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnSystemRequestNotification::OnSystemRequestNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -63,7 +65,7 @@ OnSystemRequestNotification::OnSystemRequestNotification( OnSystemRequestNotification::~OnSystemRequestNotification() {} void OnSystemRequestNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject& params = (*message_)[strings::params]; smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; @@ -96,8 +98,7 @@ void OnSystemRequestNotification::Run() { msg_params[strings::url] = policy_handler_.GetNextUpdateUrl( policy::PTUIterationType::DefaultIteration, app_id); if (0 == app_id) { - LOG4CXX_WARN(logger_, - "Can't select application to forward OnSystemRequest."); + SDL_LOG_WARN("Can't select application to forward OnSystemRequest."); return; } msg_params[strings::app_id] = app_id; @@ -110,26 +111,24 @@ void OnSystemRequestNotification::Run() { ApplicationSharedPtr app; if (msg_params.keyExists(strings::app_id)) { const uint32_t app_id = msg_params[strings::app_id].asUInt(); - LOG4CXX_DEBUG(logger_, "Received OnSystemRequest for appID " << app_id); - LOG4CXX_DEBUG(logger_, "Searching app to send OnSystemRequest by appID."); + SDL_LOG_DEBUG("Received OnSystemRequest for appID " << app_id); + SDL_LOG_DEBUG("Searching app to send OnSystemRequest by appID."); app = application_manager_.application(app_id); } else { - LOG4CXX_DEBUG(logger_, - "Received OnSystemRequest without appID." - " One of registered apps will be used."); - LOG4CXX_DEBUG(logger_, "Searching registered app to send OnSystemRequest."); + SDL_LOG_DEBUG( + "Received OnSystemRequest without appID." + " One of registered apps will be used."); + SDL_LOG_DEBUG("Searching registered app to send OnSystemRequest."); const uint32_t selected_app_id = policy_handler_.GetAppIdForSending(); if (0 == selected_app_id) { - LOG4CXX_WARN(logger_, - "Can't select application to forward OnSystemRequest."); + SDL_LOG_WARN("Can't select application to forward OnSystemRequest."); return; } app = application_manager_.application(selected_app_id); } if (app.use_count() == 0) { - LOG4CXX_WARN(logger_, - "No valid application found to forward OnSystemRequest."); + SDL_LOG_WARN("No valid application found to forward OnSystemRequest."); return; } @@ -140,16 +139,14 @@ void OnSystemRequestNotification::Run() { if (policy::kDeviceAllowed != policy_handler_.GetUserConsentForDevice(device_mac)) { - LOG4CXX_WARN(logger_, - "Application " - << app->policy_app_id() - << " is registered from non-consented device." - "Can't forward notification to application."); + SDL_LOG_WARN("Application " + << app->policy_app_id() + << " is registered from non-consented device. " + "Can't forward notification to application."); return; } - LOG4CXX_DEBUG(logger_, - "Sending request with application id " << app->policy_app_id()); + SDL_LOG_DEBUG("Sending request with application id " << app->policy_app_id()); params[strings::connection_key] = app->app_id(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc index b068835545..980c2ded17 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnSystemTimeReadyNotification::OnSystemTimeReadyNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& app_man, diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc index 293857f8d5..f652761178 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc @@ -42,6 +42,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnTTSLanguageChangeNotification::OnTTSLanguageChangeNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,7 +59,7 @@ OnTTSLanguageChangeNotification::OnTTSLanguageChangeNotification( OnTTSLanguageChangeNotification::~OnTTSLanguageChangeNotification() {} void OnTTSLanguageChangeNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.set_active_tts_language( static_cast<hmi_apis::Common_Language::eType>( @@ -72,14 +74,12 @@ void OnTTSLanguageChangeNotification::Run() { std::vector<std::string> sections_to_update{hmi_response::language}; if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::tts, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, - "Failed to save TTS.OnLanguageChange response to cache"); + SDL_LOG_ERROR("Failed to save TTS.OnLanguageChange response to cache"); } if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::vr, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, - "Failed to save VR.OnLanguageChange response to cache"); + SDL_LOG_ERROR("Failed to save VR.OnLanguageChange response to cache"); } (*message_)[strings::msg_params][strings::hmi_display_language] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc index 8b60762b31..96f6c5cd5b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc @@ -40,6 +40,8 @@ namespace commands { namespace hmi { +SDL_CREATE_LOG_VARIABLE("Commands") + OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification( OnTTSResetTimeoutNotification::~OnTTSResetTimeoutNotification() {} void OnTTSResetTimeoutNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc index 2d215b2ec9..4126a1bd21 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnTTSStartedNotification::OnTTSStartedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnTTSStartedNotification::OnTTSStartedNotification( OnTTSStartedNotification::~OnTTSStartedNotification() {} void OnTTSStartedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::TTS_Started); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc index 6910b188f2..da69c4670e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnTTSStoppedNotification::OnTTSStoppedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ OnTTSStoppedNotification::OnTTSStoppedNotification( OnTTSStoppedNotification::~OnTTSStoppedNotification() {} void OnTTSStoppedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::TTS_Stopped); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc index 6cc9f85d6f..939e3ad649 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnUICommandNotification::OnUICommandNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnUICommandNotification::OnUICommandNotification( OnUICommandNotification::~OnUICommandNotification() {} void OnUICommandNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::function_id] = static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc index f069e4ed65..d1aa146e4f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc @@ -40,6 +40,8 @@ namespace commands { namespace hmi { +SDL_CREATE_LOG_VARIABLE("Commands") + OnUIKeyBoardInputNotification::OnUIKeyBoardInputNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ OnUIKeyBoardInputNotification::OnUIKeyBoardInputNotification( OnUIKeyBoardInputNotification::~OnUIKeyBoardInputNotification() {} void OnUIKeyBoardInputNotification::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/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc index 995d69cc45..2f2cb2ddc6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc @@ -42,6 +42,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnUILanguageChangeNotification::OnUILanguageChangeNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,7 +59,7 @@ OnUILanguageChangeNotification::OnUILanguageChangeNotification( OnUILanguageChangeNotification::~OnUILanguageChangeNotification() {} void OnUILanguageChangeNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.set_active_ui_language( static_cast<hmi_apis::Common_Language::eType>( @@ -66,8 +68,7 @@ void OnUILanguageChangeNotification::Run() { std::vector<std::string> sections_to_update{hmi_response::language}; if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::ui, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, - "Failed to save UI.OnLanguageChange response to cache"); + SDL_LOG_ERROR("Failed to save UI.OnLanguageChange response to cache"); } (*message_)[strings::msg_params][strings::hmi_display_language] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc index bd1e1b8ea7..d8de31cfbc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc @@ -41,6 +41,8 @@ namespace commands { namespace hmi { +SDL_CREATE_LOG_VARIABLE("Commands") + OnUIResetTimeoutNotification::OnUIResetTimeoutNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ OnUIResetTimeoutNotification::OnUIResetTimeoutNotification( OnUIResetTimeoutNotification::~OnUIResetTimeoutNotification() {} void OnUIResetTimeoutNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_OnResetTimeout); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_subtle_alert_pressed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_subtle_alert_pressed_notification.cc index b2f5f80055..dedeb38a34 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_subtle_alert_pressed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_subtle_alert_pressed_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnUISubtleAlertPressedNotification::OnUISubtleAlertPressedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnUISubtleAlertPressedNotification::OnUISubtleAlertPressedNotification( OnUISubtleAlertPressedNotification::~OnUISubtleAlertPressedNotification() {} void OnUISubtleAlertPressedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::function_id] = static_cast<int32_t>( mobile_apis::FunctionID::eType::OnSubtleAlertPressedID); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc index 193c3666d2..ae980070ea 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc @@ -40,6 +40,8 @@ namespace commands { namespace hmi { +SDL_CREATE_LOG_VARIABLE("Commands") + OnUITouchEventNotification::OnUITouchEventNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ OnUITouchEventNotification::OnUITouchEventNotification( OnUITouchEventNotification::~OnUITouchEventNotification() {} void OnUITouchEventNotification::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/sdl_rpc_plugin/src/commands/hmi/on_ui_update_file_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_update_file_notification.cc index 4c6157c48d..b0821a0890 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_update_file_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_update_file_notification.cc @@ -40,6 +40,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnUIUpdateFileNotification::OnUIUpdateFileNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ OnUIUpdateFileNotification::OnUIUpdateFileNotification( OnUIUpdateFileNotification::~OnUIUpdateFileNotification() {} void OnUIUpdateFileNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // Prepare SmartObject for mobile factory (*message_)[strings::params][strings::function_id] = @@ -66,8 +68,7 @@ void OnUIUpdateFileNotification::Run() { auto app = application_manager_.application(app_id); if (!app) { - LOG4CXX_ERROR(logger_, - "Application with app_id " << app_id << " is not registered"); + SDL_LOG_ERROR("Application with app_id " << app_id << " is not registered"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_update_sub_menu_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_update_sub_menu_notification.cc index 4f867fd3bd..2e8c37f7cd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_update_sub_menu_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_update_sub_menu_notification.cc @@ -39,6 +39,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnUIUpdateSubMenuNotification::OnUIUpdateSubMenuNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ OnUIUpdateSubMenuNotification::OnUIUpdateSubMenuNotification( OnUIUpdateSubMenuNotification::~OnUIUpdateSubMenuNotification() {} void OnUIUpdateSubMenuNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // Prepare SmartObject for mobile factory (*message_)[strings::params][strings::function_id] = static_cast<int32_t>(mobile_apis::FunctionID::OnUpdateSubMenuID); @@ -64,8 +66,7 @@ void OnUIUpdateSubMenuNotification::Run() { auto app = application_manager_.application(app_id); if (!app) { - LOG4CXX_ERROR(logger_, - "Application with app_id " << app_id << " is not registered"); + SDL_LOG_ERROR("Application with app_id " << app_id << " is not registered"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc index e6275adab2..0ff97a664c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnUpdateDeviceList::OnUpdateDeviceList( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ OnUpdateDeviceList::OnUpdateDeviceList( OnUpdateDeviceList::~OnUpdateDeviceList() {} void OnUpdateDeviceList::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc index 99c6520fee..9f4e707b83 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIAccPedalPositionNotification::OnVIAccPedalPositionNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIAccPedalPositionNotification::OnVIAccPedalPositionNotification( OnVIAccPedalPositionNotification::~OnVIAccPedalPositionNotification() {} void OnVIAccPedalPositionNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc index dbfd9487e3..4227847153 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIBeltStatusNotification::OnVIBeltStatusNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIBeltStatusNotification::OnVIBeltStatusNotification( OnVIBeltStatusNotification::~OnVIBeltStatusNotification() {} void OnVIBeltStatusNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc index b8e66b9c0f..663f9342f4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIBodyInformationNotification::OnVIBodyInformationNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIBodyInformationNotification::OnVIBodyInformationNotification( OnVIBodyInformationNotification::~OnVIBodyInformationNotification() {} void OnVIBodyInformationNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc index 418c751d1c..62bec16546 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIDeviceStatusNotification::OnVIDeviceStatusNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIDeviceStatusNotification::OnVIDeviceStatusNotification( OnVIDeviceStatusNotification::~OnVIDeviceStatusNotification() {} void OnVIDeviceStatusNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc index 29545fcd87..722fddc5f1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIDriverBrakingNotification::OnVIDriverBrakingNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIDriverBrakingNotification::OnVIDriverBrakingNotification( OnVIDriverBrakingNotification::~OnVIDriverBrakingNotification() {} void OnVIDriverBrakingNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc index 4c2fb94400..8c524a3f1d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIEngineTorqueNotification::OnVIEngineTorqueNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIEngineTorqueNotification::OnVIEngineTorqueNotification( OnVIEngineTorqueNotification::~OnVIEngineTorqueNotification() {} void OnVIEngineTorqueNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc index 6ac26a74fc..3cbd22eb97 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIExternalTemperatureNotification::OnVIExternalTemperatureNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIExternalTemperatureNotification::OnVIExternalTemperatureNotification( OnVIExternalTemperatureNotification::~OnVIExternalTemperatureNotification() {} void OnVIExternalTemperatureNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc index 1f1cad5b8b..8065434063 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIFuelLevelNotification::OnVIFuelLevelNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIFuelLevelNotification::OnVIFuelLevelNotification( OnVIFuelLevelNotification::~OnVIFuelLevelNotification() {} void OnVIFuelLevelNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc index 31c80860fd..c0c60108f3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIFuelLevelStateNotification::OnVIFuelLevelStateNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIFuelLevelStateNotification::OnVIFuelLevelStateNotification( OnVIFuelLevelStateNotification::~OnVIFuelLevelStateNotification() {} void OnVIFuelLevelStateNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc index 43ae3524ad..1e18d18eba 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIGpsDataNotification::OnVIGpsDataNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIGpsDataNotification::OnVIGpsDataNotification( OnVIGpsDataNotification::~OnVIGpsDataNotification() {} void OnVIGpsDataNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc index 282a173b69..29906df43f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIHeadLampStatusNotification::OnVIHeadLampStatusNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIHeadLampStatusNotification::OnVIHeadLampStatusNotification( OnVIHeadLampStatusNotification::~OnVIHeadLampStatusNotification() {} void OnVIHeadLampStatusNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc index f9bb3eca3f..c4bc32e825 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIInstantFuelConsumptionNotification::OnVIInstantFuelConsumptionNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ OnVIInstantFuelConsumptionNotification:: ~OnVIInstantFuelConsumptionNotification() {} void OnVIInstantFuelConsumptionNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc index 8f5e845c02..6139d143f6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIMyKeyNotification::OnVIMyKeyNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIMyKeyNotification::OnVIMyKeyNotification( OnVIMyKeyNotification::~OnVIMyKeyNotification() {} void OnVIMyKeyNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc index ea5d8be9ca..92f4b47fcf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIOdometerNotification::OnVIOdometerNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIOdometerNotification::OnVIOdometerNotification( OnVIOdometerNotification::~OnVIOdometerNotification() {} void OnVIOdometerNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc index 73231ff4de..c2afd7d697 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIPrndlNotification::OnVIPrndlNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIPrndlNotification::OnVIPrndlNotification( OnVIPrndlNotification::~OnVIPrndlNotification() {} void OnVIPrndlNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc index 4587939b8f..f41f5d3f56 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIRpmNotification::OnVIRpmNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIRpmNotification::OnVIRpmNotification( OnVIRpmNotification::~OnVIRpmNotification() {} void OnVIRpmNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc index df0bfd5cd7..73313b6ea4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVISpeedNotification::OnVISpeedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVISpeedNotification::OnVISpeedNotification( OnVISpeedNotification::~OnVISpeedNotification() {} void OnVISpeedNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc index b7eaad7edf..e04eaab3b4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVISteeringWheelAngleNotification::OnVISteeringWheelAngleNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVISteeringWheelAngleNotification::OnVISteeringWheelAngleNotification( OnVISteeringWheelAngleNotification::~OnVISteeringWheelAngleNotification() {} void OnVISteeringWheelAngleNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc index 5f438ef8d1..bc013c2e2c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVITirePressureNotification::OnVITirePressureNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVITirePressureNotification::OnVITirePressureNotification( OnVITirePressureNotification::~OnVITirePressureNotification() {} void OnVITirePressureNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc index 1b40da4c40..4b33c2d589 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIVinNotification::OnVIVinNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIVinNotification::OnVIVinNotification( OnVIVinNotification::~OnVIVinNotification() {} void OnVIVinNotification::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/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc index 7221e88ef1..dde1e642c3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVIWiperStatusNotification::OnVIWiperStatusNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVIWiperStatusNotification::OnVIWiperStatusNotification( OnVIWiperStatusNotification::~OnVIWiperStatusNotification() {} void OnVIWiperStatusNotification::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/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc index 7d5c0165aa..a2e56300f0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVideoDataStreamingNotification::OnVideoDataStreamingNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnVideoDataStreamingNotification::OnVideoDataStreamingNotification( OnVideoDataStreamingNotification::~OnVideoDataStreamingNotification() {} void OnVideoDataStreamingNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc index c4678f69e0..366a17ec64 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc @@ -45,6 +45,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVRCommandNotification::OnVRCommandNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -60,14 +62,14 @@ OnVRCommandNotification::OnVRCommandNotification( OnVRCommandNotification::~OnVRCommandNotification() {} void OnVRCommandNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const uint32_t cmd_id = (*message_)[strings::msg_params][strings::cmd_id].asUInt(); uint32_t max_cmd_id = application_manager_.get_settings().max_cmd_id(); // Check if this is one of standard VR commands (i.e. "Help") if (cmd_id > max_cmd_id + 1) { - LOG4CXX_INFO(logger_, "Switched App"); + SDL_LOG_INFO("Switched App"); const uint32_t app_id = cmd_id - max_cmd_id; ApplicationSharedPtr app = application_manager_.application(app_id); if (app) { @@ -77,7 +79,7 @@ void OnVRCommandNotification::Run() { mobile_apis::HMILevel::HMI_FULL, true); } else { - LOG4CXX_ERROR(logger_, "Unable to find appication " << app_id); + SDL_LOG_ERROR("Unable to find appication " << app_id); } return; } @@ -90,7 +92,7 @@ void OnVRCommandNotification::Run() { (*message_)[strings::msg_params][strings::app_id].asUInt(); ApplicationSharedPtr app = application_manager_.application(app_id); if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } /* check if perform interaction is active diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc index 1500f272ab..0fe84bc0df 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc @@ -43,6 +43,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVRLanguageChangeNotification::OnVRLanguageChangeNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -58,7 +60,7 @@ OnVRLanguageChangeNotification::OnVRLanguageChangeNotification( OnVRLanguageChangeNotification::~OnVRLanguageChangeNotification() {} void OnVRLanguageChangeNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.set_active_vr_language( static_cast<hmi_apis::Common_Language::eType>( @@ -67,8 +69,7 @@ void OnVRLanguageChangeNotification::Run() { std::vector<std::string> sections_to_update{hmi_response::language}; if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::vr, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, - "Failed to save VR.OnLanguageChange response to cache"); + SDL_LOG_ERROR("Failed to save VR.OnLanguageChange response to cache"); } (*message_)[strings::msg_params][strings::hmi_display_language] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc index bfc033a865..ab0ef67535 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVRStartedNotification::OnVRStartedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnVRStartedNotification::OnVRStartedNotification( OnVRStartedNotification::~OnVRStartedNotification() {} void OnVRStartedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::VR_Started); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc index ede1efab85..e784eac244 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnVRStoppedNotification::OnVRStoppedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnVRStoppedNotification::OnVRStoppedNotification( OnVRStoppedNotification::~OnVRStoppedNotification() {} void OnVRStoppedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::VR_Stopped); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc index d882dcd6e7..774acf54f1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCGetCapabilitiesRequest::RCGetCapabilitiesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,13 +54,13 @@ RCGetCapabilitiesRequest::RCGetCapabilitiesRequest( RCGetCapabilitiesRequest::~RCGetCapabilitiesRequest() {} void RCGetCapabilitiesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void RCGetCapabilitiesRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::RC_GetCapabilities); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc index 910c12e979..10507a516f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCGetCapabilitiesResponse::RCGetCapabilitiesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ RCGetCapabilitiesResponse::RCGetCapabilitiesResponse( RCGetCapabilitiesResponse::~RCGetCapabilitiesResponse() {} void RCGetCapabilitiesResponse::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()); @@ -60,8 +62,7 @@ void RCGetCapabilitiesResponse::Run() { hmi_apis::FunctionID::RC_GetCapabilities); 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; } @@ -89,8 +90,7 @@ void RCGetCapabilitiesResponse::Run() { if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::rc, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, - "Failed to save RC.GetCapabilities response to cache"); + SDL_LOG_ERROR("Failed to save RC.GetCapabilities response to cache"); } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc index 4ea0d43dc3..c9a9af87fb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCIsReadyRequest::RCIsReadyRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,17 +59,17 @@ RCIsReadyRequest::RCIsReadyRequest( RCIsReadyRequest::~RCIsReadyRequest() {} void RCIsReadyRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); subscribe_on_event(hmi_apis::FunctionID::RC_IsReady, correlation_id()); SendRequest(); } void RCIsReadyRequest::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::RC_IsReady: { - LOG4CXX_DEBUG(logger_, "Received RC_IsReady event"); + SDL_LOG_DEBUG("Received RC_IsReady event"); unsubscribe_from_event(hmi_apis::FunctionID::RC_IsReady); const bool is_available = app_mngr::commands::ChangeInterfaceState( application_manager_, message, HmiInterfaces::HMI_INTERFACE_RC); @@ -82,15 +84,14 @@ void RCIsReadyRequest::on_event(const event_engine::Event& event) { application_manager_, HmiInterfaces::HMI_INTERFACE_RC)) { hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::RC_GetCapabilities); - LOG4CXX_INFO(logger_, - "HmiInterfaces::HMI_INTERFACE_RC isn't available"); + SDL_LOG_INFO("HmiInterfaces::HMI_INTERFACE_RC isn't available"); return; } RequestInterfaceCapabilities(hmi_interface::rc); 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/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc index 71e16a831c..1ad9a30a23 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RCIsReadyResponse::RCIsReadyResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ RCIsReadyResponse::RCIsReadyResponse( RCIsReadyResponse::~RCIsReadyResponse() {} void RCIsReadyResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::RC_IsReady); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc index 0a6632fca8..527cf911b9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc @@ -82,6 +82,8 @@ struct SendLaunchApp }; } // namespace +SDL_CREATE_LOG_VARIABLE("Commands") + SDLActivateAppRequest::SDLActivateAppRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -99,12 +101,11 @@ SDLActivateAppRequest::~SDLActivateAppRequest() {} uint32_t SDLActivateAppRequest::app_id() const { using namespace strings; if (!(*message_).keyExists(msg_params)) { - LOG4CXX_DEBUG(logger_, msg_params << " section is absent in the message."); + SDL_LOG_DEBUG(msg_params << " section is absent in the message."); return 0; } if (!(*message_)[msg_params].keyExists(strings::app_id)) { - LOG4CXX_DEBUG(logger_, - strings::app_id << " section is absent in the message."); + SDL_LOG_DEBUG(strings::app_id << " section is absent in the message."); return 0; } return (*message_)[msg_params][strings::app_id].asUInt(); @@ -112,22 +113,22 @@ uint32_t SDLActivateAppRequest::app_id() const { #ifdef EXTERNAL_PROPRIETARY_MODE void SDLActivateAppRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace hmi_apis::FunctionID; ApplicationConstSharedPtr app = application_manager_.WaitingApplicationByID(app_id()); if (application_manager_.state_controller().IsStateActive( HmiState::STATE_ID_DEACTIVATE_HMI)) { - LOG4CXX_DEBUG(logger_, - "DeactivateHmi state is active. " - "Sends response with result code REJECTED"); + SDL_LOG_DEBUG( + "DeactivateHmi state is active. " + "Sends response with result code REJECTED"); SendErrorResponse(correlation_id(), static_cast<eType>(function_id()), hmi_apis::Common_Result::REJECTED, "HMIDeactivate is active"); } else if (app && !app->IsRegistered() && app->is_cloud_app()) { - LOG4CXX_DEBUG(logger_, "Starting cloud application."); + SDL_LOG_DEBUG("Starting cloud application."); const ApplicationManagerSettings& settings = application_manager_.get_settings(); uint32_t total_retry_timeout = (settings.cloud_app_retry_timeout() * @@ -144,7 +145,7 @@ void SDLActivateAppRequest::Run() { #else // EXTERNAL_PROPRIETARY_MODE void SDLActivateAppRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace hmi_apis::FunctionID; using namespace hmi_apis::Common_Result; @@ -162,22 +163,20 @@ void SDLActivateAppRequest::Run() { application_manager_.WaitingApplicationByID(application_id); if (!app_to_activate) { - LOG4CXX_WARN( - logger_, + SDL_LOG_WARN( "Can't find application within waiting apps: " << application_id); return; } } - LOG4CXX_DEBUG(logger_, - "Found application to activate. Application id is " - << app_to_activate->app_id()); + SDL_LOG_DEBUG("Found application to activate. Application id is " + << app_to_activate->app_id()); if (application_manager_.state_controller().IsStateActive( HmiState::StateID::STATE_ID_DEACTIVATE_HMI)) { - LOG4CXX_WARN(logger_, - "DeactivateHmi state is active. " - "Sends response with result code REJECTED"); + SDL_LOG_WARN( + "DeactivateHmi state is active. " + "Sends response with result code REJECTED"); SendErrorResponse(correlation_id(), static_cast<hmi_apis::FunctionID::eType>(function_id()), hmi_apis::Common_Result::REJECTED, @@ -186,11 +185,11 @@ void SDLActivateAppRequest::Run() { } if (app_to_activate->IsRegistered()) { - LOG4CXX_DEBUG(logger_, "Application is registered. Activating."); + SDL_LOG_DEBUG("Application is registered. Activating."); policy_handler_.OnActivateApp(application_id, correlation_id()); return; } else if (app_to_activate->is_cloud_app()) { - LOG4CXX_DEBUG(logger_, "Starting cloud application."); + SDL_LOG_DEBUG("Starting cloud application."); const ApplicationManagerSettings& settings = application_manager_.get_settings(); uint32_t total_retry_timeout = (settings.cloud_app_retry_timeout() * @@ -208,29 +207,29 @@ void SDLActivateAppRequest::Run() { V4ProtoApps v4_proto_apps = get_v4_proto_apps(device_handle); if (!foreground_v4_app && v4_proto_apps.empty()) { - LOG4CXX_ERROR(logger_, - "Can't find regular foreground app with the same " - "connection id:" - << device_handle); + SDL_LOG_ERROR( + "Can't find regular foreground app with the same " + "connection id: " + << device_handle); SendErrorResponse( correlation_id(), SDL_ActivateApp, NO_APPS_REGISTERED, ""); return; } - LOG4CXX_DEBUG(logger_, - "Application is not registered yet. " - "Sending launch request."); + SDL_LOG_DEBUG( + "Application is not registered yet. " + "Sending launch request."); if (foreground_v4_app) { - LOG4CXX_DEBUG(logger_, "Sending request to foreground application."); + SDL_LOG_DEBUG("Sending request to foreground application."); MessageHelper::SendLaunchApp(foreground_v4_app->app_id(), app_to_activate->SchemaUrl(), app_to_activate->PackageName(), application_manager_); } else { - LOG4CXX_DEBUG(logger_, - "No preffered (foreground) application is found. " - "Sending request to all v4 applications."); + SDL_LOG_DEBUG( + "No preffered (foreground) application is found. " + "Sending request to all v4 applications."); std::for_each(v4_proto_apps.begin(), v4_proto_apps.end(), SendLaunchApp(app_to_activate, application_manager_)); @@ -266,8 +265,8 @@ void SDLActivateAppRequest::on_event(const event_engine::Event& event) { ApplicationSharedPtr app = application_manager_.application_by_hmi_app(hmi_application_id); if (!app) { - LOG4CXX_ERROR( - logger_, "Application not found by HMI app id: " << hmi_application_id); + SDL_LOG_ERROR( + "Application not found by HMI app id: " << hmi_application_id); return; } policy_handler_.OnActivateApp(app->app_id(), correlation_id()); @@ -277,16 +276,15 @@ uint32_t SDLActivateAppRequest::hmi_app_id( const smart_objects::SmartObject& so) const { using namespace strings; if (!so.keyExists(params)) { - LOG4CXX_DEBUG(logger_, params << " section is absent in the message."); + SDL_LOG_DEBUG(params << " section is absent in the message."); return 0; } if (!so[msg_params].keyExists(application)) { - LOG4CXX_DEBUG(logger_, application << " section is absent in the message."); + SDL_LOG_DEBUG(application << " section is absent in the message."); return 0; } if (!so[msg_params][application].keyExists(strings::app_id)) { - LOG4CXX_DEBUG(logger_, - strings::app_id << " section is absent in the message."); + SDL_LOG_DEBUG(strings::app_id << " section is absent in the message."); return 0; } return so[msg_params][application][strings::app_id].asUInt(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc index 560b75213c..2748c23a65 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SDLActivateAppResponse::SDLActivateAppResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ SDLActivateAppResponse::SDLActivateAppResponse( SDLActivateAppResponse::~SDLActivateAppResponse() {} void SDLActivateAppResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_; (*message_)[strings::params][strings::protocol_version] = protocol_version_; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc index c8266e0f39..6cf855904c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SDLGetListOfPermissionsRequest::SDLGetListOfPermissionsRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ SDLGetListOfPermissionsRequest::SDLGetListOfPermissionsRequest( SDLGetListOfPermissionsRequest::~SDLGetListOfPermissionsRequest() {} void SDLGetListOfPermissionsRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); uint32_t connection_key = 0; if ((*message_)[strings::msg_params].keyExists(strings::app_id)) { connection_key = (*message_)[strings::msg_params][strings::app_id].asUInt(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc index 280d2cb071..b27fe08b47 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SDLGetListOfPermissionsResponse::SDLGetListOfPermissionsResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ SDLGetListOfPermissionsResponse::SDLGetListOfPermissionsResponse( SDLGetListOfPermissionsResponse::~SDLGetListOfPermissionsResponse() {} void SDLGetListOfPermissionsResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_; (*message_)[strings::params][strings::protocol_version] = protocol_version_; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_request.cc index 52b7f83e9b..7478a40eeb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SDLGetPolicyConfigurationDataRequest::SDLGetPolicyConfigurationDataRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ SDLGetPolicyConfigurationDataRequest::SDLGetPolicyConfigurationDataRequest( SDLGetPolicyConfigurationDataRequest::~SDLGetPolicyConfigurationDataRequest() {} void SDLGetPolicyConfigurationDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject response_value( smart_objects::SmartType::SmartType_Array); @@ -63,7 +65,7 @@ void SDLGetPolicyConfigurationDataRequest::Run() { PrepareResponseParams(response_value); if (hmi_apis::Common_Result::SUCCESS != result_code) { - LOG4CXX_ERROR(logger_, "Unable to PrepareResponseParams"); + SDL_LOG_ERROR("Unable to PrepareResponseParams"); SendErrorResponse( correlation_id(), hmi_apis::FunctionID::SDL_GetPolicyConfigurationData, @@ -87,7 +89,7 @@ void SDLGetPolicyConfigurationDataRequest::Run() { hmi_apis::Common_Result::eType SDLGetPolicyConfigurationDataRequest::PrepareResponseParams( smart_objects::SmartObject& response_out) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto policy_type = (*message_)[strings::msg_params][strings::policy_type].asString(); @@ -96,17 +98,15 @@ SDLGetPolicyConfigurationDataRequest::PrepareResponseParams( auto policy_table_data = policy_handler_.GetPolicyTableData(); if (!policy_table_data.isMember(policy_type)) { - LOG4CXX_ERROR( - logger_, - "policy_type " << policy_type << " doesn't exist in policy table."); + SDL_LOG_ERROR("policy_type " << policy_type + << " doesn't exist in policy table."); return hmi_apis::Common_Result::DATA_NOT_AVAILABLE; } auto& policy_section_table_data = policy_table_data[policy_type]; if (!policy_section_table_data.isMember(property)) { - LOG4CXX_ERROR( - logger_, - "property " << property << " doesn't exist in " << policy_type); + SDL_LOG_ERROR("property " << property << " doesn't exist in " + << policy_type); return hmi_apis::Common_Result::DATA_NOT_AVAILABLE; } @@ -126,7 +126,7 @@ void clear_new_line_symbol(std::string& str_to_clear) { smart_objects::SmartObject SDLGetPolicyConfigurationDataRequest::GetValueParam( const Json::Value& policy_property) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject value(smart_objects::SmartType_Array); auto put_element_in_value_array = [&value](const Json::Value& element, diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_response.cc index 21b7dea41c..c934ef7bab 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_policy_configuration_data_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SDLGetPolicyConfigurationDataResponse::SDLGetPolicyConfigurationDataResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ SDLGetPolicyConfigurationDataResponse:: ~SDLGetPolicyConfigurationDataResponse() {} void SDLGetPolicyConfigurationDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_; (*message_)[strings::params][strings::protocol_version] = protocol_version_; rpc_service_.SendMessageToHMI(message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc index b494be56e8..ce1cb6b098 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SDLGetStatusUpdateRequest::SDLGetStatusUpdateRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ SDLGetStatusUpdateRequest::SDLGetStatusUpdateRequest( SDLGetStatusUpdateRequest::~SDLGetStatusUpdateRequest() {} void SDLGetStatusUpdateRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); policy_handler_.OnGetStatusUpdate( (*message_)[strings::params][strings::correlation_id].asUInt()); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc index 4b0f3d0ca8..122c209906 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SDLGetStatusUpdateResponse::SDLGetStatusUpdateResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ SDLGetStatusUpdateResponse::SDLGetStatusUpdateResponse( SDLGetStatusUpdateResponse::~SDLGetStatusUpdateResponse() {} void SDLGetStatusUpdateResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_; (*message_)[strings::params][strings::protocol_version] = protocol_version_; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc index f853cf814c..e58961e581 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SDLGetUserFriendlyMessageRequest::SDLGetUserFriendlyMessageRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,11 +56,10 @@ SDLGetUserFriendlyMessageRequest::SDLGetUserFriendlyMessageRequest( SDLGetUserFriendlyMessageRequest::~SDLGetUserFriendlyMessageRequest() {} void SDLGetUserFriendlyMessageRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const std::string messageCodes = "messageCodes"; if (!(*message_)[strings::msg_params].keyExists(messageCodes)) { - LOG4CXX_WARN(logger_, - "Mandatory parameter '" + messageCodes + "'' is missing"); + SDL_LOG_WARN("Mandatory parameter '" + messageCodes + "'' is missing"); return; } smart_objects::SmartArray* msg = @@ -71,7 +72,7 @@ void SDLGetUserFriendlyMessageRequest::Run() { for (; it != it_end; ++it) { std::string str = (*it).asString(); if (!CheckSyntax(str)) { - LOG4CXX_WARN(logger_, "Invalid data"); + SDL_LOG_WARN("Invalid data"); SendErrorResponse(correlation_id(), static_cast<hmi_apis::FunctionID::eType>(function_id()), hmi_apis::Common_Result::INVALID_DATA, diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc index b95591c4fa..b56a664e4a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SDLGetUserFriendlyMessageResponse::SDLGetUserFriendlyMessageResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ SDLGetUserFriendlyMessageResponse::SDLGetUserFriendlyMessageResponse( SDLGetUserFriendlyMessageResponse::~SDLGetUserFriendlyMessageResponse() {} void SDLGetUserFriendlyMessageResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_; (*message_)[strings::params][strings::protocol_version] = protocol_version_; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc index 5f69903548..fa5e1beeb9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SDLPolicyUpdate::SDLPolicyUpdate( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,13 +54,13 @@ SDLPolicyUpdate::SDLPolicyUpdate( SDLPolicyUpdate::~SDLPolicyUpdate() {} void SDLPolicyUpdate::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); #if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE) SendRequest(); #else - LOG4CXX_WARN(logger_, - "This RPC is part of extended policy flow." - "Please re-build with extended policy mode enabled."); + SDL_LOG_WARN( + "This RPC is part of extended policy flow. " + "Please re-build with extended policy mode enabled."); #endif } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc index bfbf73270e..5b76a405d6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc @@ -37,6 +37,9 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { + +SDL_CREATE_LOG_VARIABLE("Commands") + SDLPolicyUpdateResponse::SDLPolicyUpdateResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +55,7 @@ SDLPolicyUpdateResponse::SDLPolicyUpdateResponse( SDLPolicyUpdateResponse::~SDLPolicyUpdateResponse() {} void SDLPolicyUpdateResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const hmi_apis::Common_Result::eType code = static_cast<hmi_apis::Common_Result::eType>( (*message_)[strings::params][hmi_response::code].asInt()); @@ -62,7 +65,7 @@ void SDLPolicyUpdateResponse::Run() { helpers::ALL>(code, hmi_apis::Common_Result::SUCCESS, hmi_apis::Common_Result::WARNINGS)) { - LOG4CXX_ERROR(logger_, "Error is returned. PTU won't be started."); + SDL_LOG_ERROR("Error is returned. PTU won't be started."); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc index 988be68a80..84ea5590d3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSChangeRegistrationRequest::TTSChangeRegistrationRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ TTSChangeRegistrationRequest::TTSChangeRegistrationRequest( TTSChangeRegistrationRequest::~TTSChangeRegistrationRequest() {} void TTSChangeRegistrationRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc index e5e38ef34a..521df2ed6d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSChangeRegistratioResponse::TTSChangeRegistratioResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ TTSChangeRegistratioResponse::TTSChangeRegistratioResponse( TTSChangeRegistratioResponse::~TTSChangeRegistratioResponse() {} void TTSChangeRegistratioResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::TTS_ChangeRegistration); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc index 85f0b93b8c..3bca6c05c1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSGetCapabilitiesRequest::TTSGetCapabilitiesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,13 +54,13 @@ TTSGetCapabilitiesRequest::TTSGetCapabilitiesRequest( TTSGetCapabilitiesRequest::~TTSGetCapabilitiesRequest() {} void TTSGetCapabilitiesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void TTSGetCapabilitiesRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::TTS_GetCapabilities); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc index e6edcdb365..167966e55b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSGetCapabilitiesResponse::TTSGetCapabilitiesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ TTSGetCapabilitiesResponse::TTSGetCapabilitiesResponse( TTSGetCapabilitiesResponse::~TTSGetCapabilitiesResponse() {} void TTSGetCapabilitiesResponse::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()); @@ -59,8 +61,7 @@ void TTSGetCapabilitiesResponse::Run() { hmi_apis::FunctionID::TTS_GetCapabilities); 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; } @@ -81,8 +82,7 @@ void TTSGetCapabilitiesResponse::Run() { if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::tts, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, - "Failed to save TTS.GetCapabilities response to cache"); + SDL_LOG_ERROR("Failed to save TTS.GetCapabilities response to cache"); } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc index d62c9627f5..2b409c68de 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSGetLanguageRequest::TTSGetLanguageRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,13 +54,13 @@ TTSGetLanguageRequest::TTSGetLanguageRequest( TTSGetLanguageRequest::~TTSGetLanguageRequest() {} void TTSGetLanguageRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void TTSGetLanguageRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::TTS_GetLanguage); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc index 1487fd7915..2b14bea681 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSGetLanguageResponse::TTSGetLanguageResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ TTSGetLanguageResponse::TTSGetLanguageResponse( TTSGetLanguageResponse::~TTSGetLanguageResponse() {} void TTSGetLanguageResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace hmi_apis; const Common_Result::eType result_code = static_cast<Common_Result::eType>( @@ -63,8 +65,7 @@ void TTSGetLanguageResponse::Run() { hmi_apis::FunctionID::TTS_GetLanguage); if (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; } @@ -81,13 +82,11 @@ void TTSGetLanguageResponse::Run() { std::vector<std::string> sections_to_update{hmi_response::language}; if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::tts, sections_to_update, message_->getSchema())) { - LOG4CXX_DEBUG(logger_, "Failed to save TTS.GetLanguage response to cache"); + SDL_LOG_DEBUG("Failed to save TTS.GetLanguage response to cache"); } - LOG4CXX_DEBUG(logger_, - "Raising event for function_id " << function_id() - << " and correlation_id " - << correlation_id()); + SDL_LOG_DEBUG("Raising event for function_id " + << function_id() << " and correlation_id " << correlation_id()); event_engine::Event event(FunctionID::TTS_GetLanguage); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc index 5d758c84b7..87df2402bb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSGetSupportedLanguagesRequest::TTSGetSupportedLanguagesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,13 +54,13 @@ TTSGetSupportedLanguagesRequest::TTSGetSupportedLanguagesRequest( TTSGetSupportedLanguagesRequest::~TTSGetSupportedLanguagesRequest() {} void TTSGetSupportedLanguagesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void TTSGetSupportedLanguagesRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::TTS_GetSupportedLanguages); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc index baa10394c5..6b074005b2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSGetSupportedLanguagesResponse::TTSGetSupportedLanguagesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ TTSGetSupportedLanguagesResponse::TTSGetSupportedLanguagesResponse( TTSGetSupportedLanguagesResponse::~TTSGetSupportedLanguagesResponse() {} void TTSGetSupportedLanguagesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const hmi_apis::Common_Result::eType code = static_cast<hmi_apis::Common_Result::eType>( @@ -63,8 +65,7 @@ void TTSGetSupportedLanguagesResponse::Run() { hmi_apis::FunctionID::TTS_GetSupportedLanguages); if (hmi_apis::Common_Result::SUCCESS != 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; } @@ -74,8 +75,7 @@ void TTSGetSupportedLanguagesResponse::Run() { std::vector<std::string> sections_to_update{hmi_response::languages}; if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::tts, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, - "Failed to save TTS.GetSupportedLanguages response to cache"); + SDL_LOG_ERROR("Failed to save TTS.GetSupportedLanguages response to cache"); } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc index 4ae737bec4..1f1f3e7eab 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSIsReadyRequest::TTSIsReadyRequest( const app_mngr::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,18 +56,18 @@ TTSIsReadyRequest::TTSIsReadyRequest( TTSIsReadyRequest::~TTSIsReadyRequest() {} void TTSIsReadyRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); subscribe_on_event(hmi_apis::FunctionID::TTS_IsReady, correlation_id()); SendRequest(); } void TTSIsReadyRequest::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::TTS_IsReady: { - LOG4CXX_DEBUG(logger_, "Received TTS_IsReady event"); + SDL_LOG_DEBUG("Received TTS_IsReady event"); unsubscribe_from_event(hmi_apis::FunctionID::TTS_IsReady); const bool is_available = app_mngr::commands::ChangeInterfaceState( application_manager_, message, HmiInterfaces::HMI_INTERFACE_TTS); @@ -74,8 +76,7 @@ void TTSIsReadyRequest::on_event(const event_engine::Event& event) { if (!app_mngr::commands::CheckAvailabilityHMIInterfaces( application_manager_, HmiInterfaces::HMI_INTERFACE_TTS)) { UpdateRequiredInterfaceCapabilitiesRequests(hmi_interface::tts); - LOG4CXX_INFO(logger_, - "HmiInterfaces::HMI_INTERFACE_TTS isn't available"); + SDL_LOG_INFO("HmiInterfaces::HMI_INTERFACE_TTS isn't available"); return; } @@ -83,7 +84,7 @@ void TTSIsReadyRequest::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/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc index 67e0fb6396..c94210e330 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSIsReadyResponse::TTSIsReadyResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ TTSIsReadyResponse::TTSIsReadyResponse( TTSIsReadyResponse::~TTSIsReadyResponse() {} void TTSIsReadyResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::TTS_IsReady); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc index 0b3d9a77bf..f2a8dad4bc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSSetGlobalPropertiesRequest::TTSSetGlobalPropertiesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ TTSSetGlobalPropertiesRequest::TTSSetGlobalPropertiesRequest( TTSSetGlobalPropertiesRequest::~TTSSetGlobalPropertiesRequest() {} void TTSSetGlobalPropertiesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc index 0901378c4a..35b3ce87d3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSSetGlobalPropertiesResponse::TTSSetGlobalPropertiesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ TTSSetGlobalPropertiesResponse::TTSSetGlobalPropertiesResponse( TTSSetGlobalPropertiesResponse::~TTSSetGlobalPropertiesResponse() {} void TTSSetGlobalPropertiesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc index 6dce94f931..0dd48f90a9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSSpeakRequest::TTSSpeakRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ TTSSpeakRequest::TTSSpeakRequest( TTSSpeakRequest::~TTSSpeakRequest() {} void TTSSpeakRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc index 69be5ab160..c461996358 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSSpeakResponse::TTSSpeakResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ TTSSpeakResponse::TTSSpeakResponse( TTSSpeakResponse::~TTSSpeakResponse() {} void TTSSpeakResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::TTS_Speak); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc index 43c595040c..8e6270e643 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSStopSpeakingRequest::TTSStopSpeakingRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ TTSStopSpeakingRequest::TTSStopSpeakingRequest( TTSStopSpeakingRequest::~TTSStopSpeakingRequest() {} void TTSStopSpeakingRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc index 892b3e6295..64d76dcec2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + TTSStopSpeakingResponse::TTSStopSpeakingResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ TTSStopSpeakingResponse::TTSStopSpeakingResponse( TTSStopSpeakingResponse::~TTSStopSpeakingResponse() {} void TTSStopSpeakingResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::TTS_StopSpeaking); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc index 7c95e8a919..eadd0f59cd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIAddCommandRequest::UIAddCommandRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UIAddCommandRequest::UIAddCommandRequest( UIAddCommandRequest::~UIAddCommandRequest() {} void UIAddCommandRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc index 72d841a878..9a582807a9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIAddCommandResponse::UIAddCommandResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ UIAddCommandResponse::UIAddCommandResponse( UIAddCommandResponse::~UIAddCommandResponse() {} void UIAddCommandResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_AddCommand); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc index 15342c6ecb..a854a115b6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIAddSubmenuRequest::UIAddSubmenuRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UIAddSubmenuRequest::UIAddSubmenuRequest( UIAddSubmenuRequest::~UIAddSubmenuRequest() {} void UIAddSubmenuRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc index ae699dc2bd..89aa425cfb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIAddSubmenuResponse::UIAddSubmenuResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UIAddSubmenuResponse::UIAddSubmenuResponse( UIAddSubmenuResponse::~UIAddSubmenuResponse() {} void UIAddSubmenuResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_AddSubMenu); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc index 793e70d9e1..def1636fbd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIAlertRequest::UIAlertRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ UIAlertRequest::UIAlertRequest( UIAlertRequest::~UIAlertRequest() {} void UIAlertRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc index f53f14e050..e1a5afa5e5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIAlertResponse::UIAlertResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UIAlertResponse::UIAlertResponse( UIAlertResponse::~UIAlertResponse() {} void UIAlertResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_Alert); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_request.cc index c186077b1e..db35e550bc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UICancelInteractionRequest::UICancelInteractionRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UICancelInteractionRequest::UICancelInteractionRequest( UICancelInteractionRequest::~UICancelInteractionRequest() {} void UICancelInteractionRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_response.cc index 2d5db4eecb..29d18ba384 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_cancel_interaction_response.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UICancelInteractionResponse::UICancelInteractionResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UICancelInteractionResponse::UICancelInteractionResponse( UICancelInteractionResponse::~UICancelInteractionResponse() {} void UICancelInteractionResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_CancelInteraction); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc index bb001b37c7..3ba9d149c4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIChangeRegistrationRequest::UIChangeRegistrationRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UIChangeRegistrationRequest::UIChangeRegistrationRequest( UIChangeRegistrationRequest::~UIChangeRegistrationRequest() {} void UIChangeRegistrationRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc index 8acd654488..1790f44bce 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIChangeRegistratioResponse::UIChangeRegistratioResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UIChangeRegistratioResponse::UIChangeRegistratioResponse( UIChangeRegistratioResponse::~UIChangeRegistratioResponse() {} void UIChangeRegistratioResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_ChangeRegistration); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_request.cc index b354009e3f..90071bb351 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UICreateWindowRequest::UICreateWindowRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UICreateWindowRequest::UICreateWindowRequest( UICreateWindowRequest::~UICreateWindowRequest() {} void UICreateWindowRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_response.cc index c3a323818d..1021e47595 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_create_window_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UICreateWindowResponse::UICreateWindowResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ UICreateWindowResponse::UICreateWindowResponse( UICreateWindowResponse::~UICreateWindowResponse() {} void UICreateWindowResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_CreateWindow); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc index 1d741bba74..2b46723216 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIDeleteCommandRequest::UIDeleteCommandRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UIDeleteCommandRequest::UIDeleteCommandRequest( UIDeleteCommandRequest::~UIDeleteCommandRequest() {} void UIDeleteCommandRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc index 40a5ec8a73..0cd3e1943d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIDeleteCommandResponse::UIDeleteCommandResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UIDeleteCommandResponse::UIDeleteCommandResponse( UIDeleteCommandResponse::~UIDeleteCommandResponse() {} void UIDeleteCommandResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_DeleteCommand); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc index fdca37cee6..ea5745486a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIDeleteSubmenuRequest::UIDeleteSubmenuRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UIDeleteSubmenuRequest::UIDeleteSubmenuRequest( UIDeleteSubmenuRequest::~UIDeleteSubmenuRequest() {} void UIDeleteSubmenuRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc index 9d522431dc..0d2d5360cc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIDeleteSubmenuResponse::UIDeleteSubmenuResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UIDeleteSubmenuResponse::UIDeleteSubmenuResponse( UIDeleteSubmenuResponse::~UIDeleteSubmenuResponse() {} void UIDeleteSubmenuResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_DeleteSubMenu); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_request.cc index 7933574d92..066b5969a6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIDeleteWindowRequest::UIDeleteWindowRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UIDeleteWindowRequest::UIDeleteWindowRequest( UIDeleteWindowRequest::~UIDeleteWindowRequest() {} void UIDeleteWindowRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_response.cc index ba703e18ae..507369c4f7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_window_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIDeleteWindowResponse::UIDeleteWindowResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ UIDeleteWindowResponse::UIDeleteWindowResponse( UIDeleteWindowResponse::~UIDeleteWindowResponse() {} void UIDeleteWindowResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_DeleteWindow); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc index 92f51bc9cf..3e99b5298e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIEndAudioPassThruRequest::UIEndAudioPassThruRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UIEndAudioPassThruRequest::UIEndAudioPassThruRequest( UIEndAudioPassThruRequest::~UIEndAudioPassThruRequest() {} void UIEndAudioPassThruRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc index b6639dcbb9..3b9f56f7e6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIEndAudioPassThruResponse::UIEndAudioPassThruResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UIEndAudioPassThruResponse::UIEndAudioPassThruResponse( UIEndAudioPassThruResponse::~UIEndAudioPassThruResponse() {} void UIEndAudioPassThruResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_EndAudioPassThru); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc index 32c19eabcd..00a8ad761e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIGetCapabilitiesRequest::UIGetCapabilitiesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,13 +54,13 @@ UIGetCapabilitiesRequest::UIGetCapabilitiesRequest( UIGetCapabilitiesRequest::~UIGetCapabilitiesRequest() {} void UIGetCapabilitiesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void UIGetCapabilitiesRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::UI_GetCapabilities); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc index f966f299c1..31dda22709 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIGetCapabilitiesResponse::UIGetCapabilitiesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ UIGetCapabilitiesResponse::UIGetCapabilitiesResponse( UIGetCapabilitiesResponse::~UIGetCapabilitiesResponse() {} void UIGetCapabilitiesResponse::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()); @@ -60,8 +62,7 @@ void UIGetCapabilitiesResponse::Run() { hmi_apis::FunctionID::UI_GetCapabilities); 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; } @@ -166,8 +167,7 @@ void UIGetCapabilitiesResponse::Run() { if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::ui, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, - "Failed to save UI.GetCapabilities response to cache"); + SDL_LOG_ERROR("Failed to save UI.GetCapabilities response to cache"); } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc index 948adbdece..bf91b7e294 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIGetLanguageRequest::UIGetLanguageRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,13 +54,13 @@ UIGetLanguageRequest::UIGetLanguageRequest( UIGetLanguageRequest::~UIGetLanguageRequest() {} void UIGetLanguageRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void UIGetLanguageRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::UI_GetLanguage); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc index e32dbf3c47..ffeec025be 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIGetLanguageResponse::UIGetLanguageResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UIGetLanguageResponse::UIGetLanguageResponse( UIGetLanguageResponse::~UIGetLanguageResponse() {} void UIGetLanguageResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace hmi_apis; const Common_Result::eType result_code = static_cast<Common_Result::eType>( (*message_)[strings::params][hmi_response::code].asInt()); @@ -63,8 +65,7 @@ void UIGetLanguageResponse::Run() { hmi_apis::FunctionID::UI_GetLanguage); if (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; } @@ -81,13 +82,11 @@ void UIGetLanguageResponse::Run() { std::vector<std::string> sections_to_update{hmi_response::language}; if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::ui, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, "Failed to save UI.GetLanguage response to cache"); + SDL_LOG_ERROR("Failed to save UI.GetLanguage response to cache"); } - LOG4CXX_DEBUG(logger_, - "Raising event for function_id " << function_id() - << " and correlation_id " - << correlation_id()); + SDL_LOG_DEBUG("Raising event for function_id " + << function_id() << " and correlation_id " << correlation_id()); event_engine::Event event(FunctionID::UI_GetLanguage); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc index 0001af9203..480fa2499f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIGetSupportedLanguagesRequest::UIGetSupportedLanguagesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,13 +54,13 @@ UIGetSupportedLanguagesRequest::UIGetSupportedLanguagesRequest( UIGetSupportedLanguagesRequest::~UIGetSupportedLanguagesRequest() {} void UIGetSupportedLanguagesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void UIGetSupportedLanguagesRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::UI_GetSupportedLanguages); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc index 53704b3705..20606294ae 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIGetSupportedLanguagesResponse::UIGetSupportedLanguagesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ UIGetSupportedLanguagesResponse::UIGetSupportedLanguagesResponse( UIGetSupportedLanguagesResponse::~UIGetSupportedLanguagesResponse() {} void UIGetSupportedLanguagesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const hmi_apis::Common_Result::eType code = static_cast<hmi_apis::Common_Result::eType>( @@ -63,8 +65,7 @@ void UIGetSupportedLanguagesResponse::Run() { hmi_apis::FunctionID::UI_GetSupportedLanguages); if (hmi_apis::Common_Result::SUCCESS != 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; } @@ -74,8 +75,7 @@ void UIGetSupportedLanguagesResponse::Run() { std::vector<std::string> sections_to_update{hmi_response::languages}; if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::ui, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, - "Failed to save UI.GetSupportedLanguages response to cache"); + SDL_LOG_ERROR("Failed to save UI.GetSupportedLanguages response to cache"); } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc index 4882095d42..d020972ce6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIIsReadyRequest::UIIsReadyRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,17 +56,17 @@ UIIsReadyRequest::UIIsReadyRequest( UIIsReadyRequest::~UIIsReadyRequest() {} void UIIsReadyRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); subscribe_on_event(hmi_apis::FunctionID::UI_IsReady, correlation_id()); SendRequest(); } void UIIsReadyRequest::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_IsReady: { - LOG4CXX_DEBUG(logger_, "Received UI_IsReady event"); + SDL_LOG_DEBUG("Received UI_IsReady event"); unsubscribe_from_event(hmi_apis::FunctionID::UI_IsReady); const bool is_available = app_mngr::commands::ChangeInterfaceState( application_manager_, message, HmiInterfaces::HMI_INTERFACE_UI); @@ -73,8 +75,7 @@ void UIIsReadyRequest::on_event(const event_engine::Event& event) { if (!app_mngr::commands::CheckAvailabilityHMIInterfaces( application_manager_, HmiInterfaces::HMI_INTERFACE_UI)) { UpdateRequiredInterfaceCapabilitiesRequests(hmi_interface::ui); - LOG4CXX_INFO(logger_, - "HmiInterfaces::HMI_INTERFACE_UI isn't available"); + SDL_LOG_INFO("HmiInterfaces::HMI_INTERFACE_UI isn't available"); return; } @@ -82,7 +83,7 @@ void UIIsReadyRequest::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/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc index 96a2d1212c..99730691de 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIIsReadyResponse::UIIsReadyResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ UIIsReadyResponse::UIIsReadyResponse( UIIsReadyResponse::~UIIsReadyResponse() {} void UIIsReadyResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_IsReady); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc index 18d5376b25..c8a3dc3704 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIPerformAudioPassThruRequest::UIPerformAudioPassThruRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UIPerformAudioPassThruRequest::UIPerformAudioPassThruRequest( UIPerformAudioPassThruRequest::~UIPerformAudioPassThruRequest() {} void UIPerformAudioPassThruRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc index afbd1bbed7..b953dc73e6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIPerformAudioPassThruResponse::UIPerformAudioPassThruResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ UIPerformAudioPassThruResponse::UIPerformAudioPassThruResponse( UIPerformAudioPassThruResponse::~UIPerformAudioPassThruResponse() {} void UIPerformAudioPassThruResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc index a07c72cbf4..83e63c006d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIPerformInteractionRequest::UIPerformInteractionRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ UIPerformInteractionRequest::UIPerformInteractionRequest( UIPerformInteractionRequest::~UIPerformInteractionRequest() {} void UIPerformInteractionRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc index 4cbc58d278..00f6f702cd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIPerformInteractionResponse::UIPerformInteractionResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ UIPerformInteractionResponse::UIPerformInteractionResponse( UIPerformInteractionResponse::~UIPerformInteractionResponse() {} void UIPerformInteractionResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_PerformInteraction); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc index cad68e23aa..366235bb6d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIScrollableMessageRequest::UIScrollableMessageRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ UIScrollableMessageRequest::UIScrollableMessageRequest( UIScrollableMessageRequest::~UIScrollableMessageRequest() {} void UIScrollableMessageRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc index 4e844095b4..b9a184528e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIScrollableMessageResponse::UIScrollableMessageResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ UIScrollableMessageResponse::UIScrollableMessageResponse( UIScrollableMessageResponse::~UIScrollableMessageResponse() {} void UIScrollableMessageResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_ScrollableMessage); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc index 4a538ac992..9e8f4837f8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISendHapticDataRequest::UISendHapticDataRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UISendHapticDataRequest::UISendHapticDataRequest( UISendHapticDataRequest::~UISendHapticDataRequest() {} void UISendHapticDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc index 92afdaaa4a..9b55d6d63d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISendHapticDataResponse::UISendHapticDataResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UISendHapticDataResponse::UISendHapticDataResponse( UISendHapticDataResponse::~UISendHapticDataResponse() {} void UISendHapticDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_SendHapticData); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc index 821f78a046..4d158bfc20 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISetAppIconRequest::UISetAppIconRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UISetAppIconRequest::UISetAppIconRequest( UISetAppIconRequest::~UISetAppIconRequest() {} void UISetAppIconRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc index 68e96725d4..91e341375b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISetAppIconResponse::UISetAppIconResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ UISetAppIconResponse::UISetAppIconResponse( UISetAppIconResponse::~UISetAppIconResponse() {} void UISetAppIconResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_SetAppIcon); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc index 63166157c8..df0f2a9f98 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UiSetDisplayLayoutRequest::UiSetDisplayLayoutRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UiSetDisplayLayoutRequest::UiSetDisplayLayoutRequest( UiSetDisplayLayoutRequest::~UiSetDisplayLayoutRequest() {} void UiSetDisplayLayoutRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc index f35427895e..35fe55ec4d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UiSetDisplayLayoutResponse::UiSetDisplayLayoutResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UiSetDisplayLayoutResponse::UiSetDisplayLayoutResponse( UiSetDisplayLayoutResponse::~UiSetDisplayLayoutResponse() {} void UiSetDisplayLayoutResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc index 0aaaae7cc7..231796f2d5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISetGlobalPropertiesRequest::UISetGlobalPropertiesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UISetGlobalPropertiesRequest::UISetGlobalPropertiesRequest( UISetGlobalPropertiesRequest::~UISetGlobalPropertiesRequest() {} void UISetGlobalPropertiesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc index 48d73d146c..e0d7f8136e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISetGlobalPropertiesResponse::UISetGlobalPropertiesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ UISetGlobalPropertiesResponse::UISetGlobalPropertiesResponse( UISetGlobalPropertiesResponse::~UISetGlobalPropertiesResponse() {} void UISetGlobalPropertiesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc index 4c8fcefcdf..fdb477e41e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISetMediaClockTimerRequest::UISetMediaClockTimerRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UISetMediaClockTimerRequest::UISetMediaClockTimerRequest( UISetMediaClockTimerRequest::~UISetMediaClockTimerRequest() {} void UISetMediaClockTimerRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc index fb5b25fc2b..3df2a14863 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISetMediaClockTimerResponse::UISetMediaClockTimerResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ UISetMediaClockTimerResponse::UISetMediaClockTimerResponse( UISetMediaClockTimerResponse::~UISetMediaClockTimerResponse() {} void UISetMediaClockTimerResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_request.cc index c2c8566e82..beba7ebba9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_request.cc @@ -37,6 +37,8 @@ namespace app_mngr = application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIShowAppMenuRequest::UIShowAppMenuRequest( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UIShowAppMenuRequest::UIShowAppMenuRequest( UIShowAppMenuRequest::~UIShowAppMenuRequest() {} void UIShowAppMenuRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_response.cc index 14bbc79e03..c0e13d377a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_app_menu_response.cc @@ -37,6 +37,9 @@ namespace sdl_rpc_plugin { namespace app_mngr = application_manager; namespace commands { + +SDL_CREATE_LOG_VARIABLE("Commands") + UIShowAppMenuResponse::UIShowAppMenuResponse( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, @@ -52,7 +55,7 @@ UIShowAppMenuResponse::UIShowAppMenuResponse( UIShowAppMenuResponse::~UIShowAppMenuResponse() {} void UIShowAppMenuResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::event_engine::Event event(hmi_apis::FunctionID::UI_ShowAppMenu); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc index d7160dc70b..4312a4d252 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIShowRequest::UIShowRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UIShowRequest::UIShowRequest( UIShowRequest::~UIShowRequest() {} void UIShowRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc index 768069bf3a..7e57aec971 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UIShowResponse::UIShowResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UIShowResponse::UIShowResponse( UIShowResponse::~UIShowResponse() {} void UIShowResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_Show); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc index eae8cc523c..63bc1e0c0e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISliderRequest::UISliderRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ UISliderRequest::UISliderRequest( UISliderRequest::~UISliderRequest() {} void UISliderRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc index 9cf7224ddb..3c78e73fdd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISliderResponse::UISliderResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ UISliderResponse::UISliderResponse( UISliderResponse::~UISliderResponse() {} void UISliderResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_Slider); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_subtle_alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_subtle_alert_request.cc index 02e9af4c3c..7136a533e6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_subtle_alert_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_subtle_alert_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISubtleAlertRequest::UISubtleAlertRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -60,7 +62,7 @@ UISubtleAlertRequest::UISubtleAlertRequest( UISubtleAlertRequest::~UISubtleAlertRequest() {} void UISubtleAlertRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_subtle_alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_subtle_alert_response.cc index 51e9802db7..a551988c07 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_subtle_alert_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_subtle_alert_response.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UISubtleAlertResponse::UISubtleAlertResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UISubtleAlertResponse::UISubtleAlertResponse( UISubtleAlertResponse::~UISubtleAlertResponse() {} void UISubtleAlertResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::UI_SubtleAlert); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc index c5966fcb36..ca23f36d5c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UpdateAppListRequest::UpdateAppListRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UpdateAppListRequest::UpdateAppListRequest( UpdateAppListRequest::~UpdateAppListRequest() {} void UpdateAppListRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc index 7fc830b4e6..3468a7a253 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UpdateAppListResponse::UpdateAppListResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UpdateAppListResponse::UpdateAppListResponse( UpdateAppListResponse::~UpdateAppListResponse() {} void UpdateAppListResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // TODO(PV): add check } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc index 3a014480c1..c8aa295645 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UpdateDeviceListRequest::UpdateDeviceListRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,7 +59,7 @@ UpdateDeviceListRequest::UpdateDeviceListRequest( UpdateDeviceListRequest::~UpdateDeviceListRequest() {} void UpdateDeviceListRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock auto_lock(wait_hmi_lock); // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA. // Flag conditional compilation for specific customer is used in order to @@ -65,10 +67,10 @@ void UpdateDeviceListRequest::Run() { // hit code to RTC if (true == application_manager_.get_settings().launch_hmi()) { if (!application_manager_.IsHMICooperating()) { - LOG4CXX_INFO(logger_, "Wait for HMI Cooperation"); + SDL_LOG_INFO("Wait for HMI Cooperation"); subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_OnReady); termination_condition_.Wait(auto_lock); - LOG4CXX_DEBUG(logger_, "HMI Cooperation OK"); + SDL_LOG_DEBUG("HMI Cooperation OK"); } } @@ -76,17 +78,17 @@ void UpdateDeviceListRequest::Run() { } void UpdateDeviceListRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock auto_lock(wait_hmi_lock); switch (event.id()) { case hmi_apis::FunctionID::BasicCommunication_OnReady: { - LOG4CXX_INFO(logger_, "received OnReady"); + SDL_LOG_INFO("received OnReady"); unsubscribe_from_event(hmi_apis::FunctionID::BasicCommunication_OnReady); termination_condition_.Broadcast(); break; }; default: { - LOG4CXX_ERROR(logger_, "Unknown event "); + SDL_LOG_ERROR("Unknown event " << event.id()); break; }; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc index d69e683f2b..9458c22aa2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UpdateDeviceListResponse::UpdateDeviceListResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ UpdateDeviceListResponse::UpdateDeviceListResponse( UpdateDeviceListResponse::~UpdateDeviceListResponse() {} void UpdateDeviceListResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // TODO(PV): add check for correctness. } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc index a52f03b998..b9c06945b6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UpdateSDLRequest::UpdateSDLRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UpdateSDLRequest::UpdateSDLRequest( UpdateSDLRequest::~UpdateSDLRequest() {} void UpdateSDLRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); policy_handler_.PTExchangeAtUserRequest( (*message_)[strings::params][strings::correlation_id].asInt()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc index c02cde4111..a6981b6d82 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UpdateSDLResponse::UpdateSDLResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ UpdateSDLResponse::UpdateSDLResponse( UpdateSDLResponse::~UpdateSDLResponse() {} void UpdateSDLResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_; (*message_)[strings::params][strings::protocol_version] = protocol_version_; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc index 788eda5a87..a26e0479c8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRAddCommandRequest::VRAddCommandRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ VRAddCommandRequest::VRAddCommandRequest( VRAddCommandRequest::~VRAddCommandRequest() {} void VRAddCommandRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc index 37b3e4696d..111fd1ffe5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRAddCommandResponse::VRAddCommandResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ VRAddCommandResponse::VRAddCommandResponse( VRAddCommandResponse::~VRAddCommandResponse() {} void VRAddCommandResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::VR_AddCommand); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc index d1be04ad44..32d326687a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRChangeRegistrationRequest::VRChangeRegistrationRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ VRChangeRegistrationRequest::VRChangeRegistrationRequest( VRChangeRegistrationRequest::~VRChangeRegistrationRequest() {} void VRChangeRegistrationRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc index 27bde2bafa..85c346421d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRChangeRegistrationResponse::VRChangeRegistrationResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ VRChangeRegistrationResponse::VRChangeRegistrationResponse( VRChangeRegistrationResponse::~VRChangeRegistrationResponse() {} void VRChangeRegistrationResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::VR_ChangeRegistration); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc index ebcfe78fa9..cc6650a7ae 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRDeleteCommandRequest::VRDeleteCommandRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ VRDeleteCommandRequest::VRDeleteCommandRequest( VRDeleteCommandRequest::~VRDeleteCommandRequest() {} void VRDeleteCommandRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc index d1d725b356..ae40f3c1f8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRDeleteCommandResponse::VRDeleteCommandResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ VRDeleteCommandResponse::VRDeleteCommandResponse( VRDeleteCommandResponse::~VRDeleteCommandResponse() {} void VRDeleteCommandResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::VR_DeleteCommand); event.set_smart_object(*message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc index dd0d78cf2d..3f528f2f58 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRGetCapabilitiesRequest::VRGetCapabilitiesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,13 +54,13 @@ VRGetCapabilitiesRequest::VRGetCapabilitiesRequest( VRGetCapabilitiesRequest::~VRGetCapabilitiesRequest() {} void VRGetCapabilitiesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void VRGetCapabilitiesRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::VR_GetCapabilities); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc index 79d532bff8..315107d94a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRGetCapabilitiesResponse::VRGetCapabilitiesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ VRGetCapabilitiesResponse::VRGetCapabilitiesResponse( VRGetCapabilitiesResponse::~VRGetCapabilitiesResponse() {} void VRGetCapabilitiesResponse::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()); @@ -59,8 +61,7 @@ void VRGetCapabilitiesResponse::Run() { hmi_apis::FunctionID::VR_GetCapabilities); 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; } @@ -75,8 +76,7 @@ void VRGetCapabilitiesResponse::Run() { if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::vr, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, - "Failed to save VR.GetCapabilities response to cache"); + SDL_LOG_ERROR("Failed to save VR.GetCapabilities response to cache"); } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc index 3aa36aee33..f5e9b0e848 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRGetLanguageRequest::VRGetLanguageRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,13 +54,13 @@ VRGetLanguageRequest::VRGetLanguageRequest( VRGetLanguageRequest::~VRGetLanguageRequest() {} void VRGetLanguageRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void VRGetLanguageRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::VR_GetLanguage); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc index 462ccc529c..e8c881f6f8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRGetLanguageResponse::VRGetLanguageResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ VRGetLanguageResponse::VRGetLanguageResponse( VRGetLanguageResponse::~VRGetLanguageResponse() {} void VRGetLanguageResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace hmi_apis; const Common_Result::eType result_code = static_cast<Common_Result::eType>( (*message_)[strings::params][hmi_response::code].asInt()); @@ -63,8 +65,7 @@ void VRGetLanguageResponse::Run() { hmi_apis::FunctionID::VR_GetLanguage); if (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; } @@ -81,13 +82,11 @@ void VRGetLanguageResponse::Run() { std::vector<std::string> sections_to_update{hmi_response::language}; if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::vr, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR(logger_, "Failed to save VR.GetLanguage response to cache"); + SDL_LOG_ERROR("Failed to save VR.GetLanguage response to cache"); } - LOG4CXX_DEBUG(logger_, - "Raising event for function_id " << function_id() - << " and correlation_id " - << correlation_id()); + SDL_LOG_DEBUG("Raising event for function_id " + << function_id() << " and correlation_id " << correlation_id()); event_engine::Event event(FunctionID::VR_GetLanguage); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc index 5755b91ab6..73e68e8503 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRGetSupportedLanguagesRequest::VRGetSupportedLanguagesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,13 +54,13 @@ VRGetSupportedLanguagesRequest::VRGetSupportedLanguagesRequest( VRGetSupportedLanguagesRequest::~VRGetSupportedLanguagesRequest() {} void VRGetSupportedLanguagesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } void VRGetSupportedLanguagesRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); hmi_capabilities_.UpdateRequestsRequiredForCapabilities( hmi_apis::FunctionID::VR_GetSupportedLanguages); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc index 59602cf10a..72278fcddd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRGetSupportedLanguagesResponse::VRGetSupportedLanguagesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ VRGetSupportedLanguagesResponse::VRGetSupportedLanguagesResponse( VRGetSupportedLanguagesResponse::~VRGetSupportedLanguagesResponse() {} void VRGetSupportedLanguagesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const hmi_apis::Common_Result::eType code = static_cast<hmi_apis::Common_Result::eType>( @@ -71,8 +73,8 @@ void VRGetSupportedLanguagesResponse::Run() { std::vector<std::string> sections_to_update{hmi_response::languages}; if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( hmi_interface::vr, sections_to_update, message_->getSchema())) { - LOG4CXX_ERROR( - logger_, "Failed to save VR.GetSupportedLanguages response to cache"); + SDL_LOG_ERROR( + "Failed to save VR.GetSupportedLanguages response to cache"); } } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc index f65f58f423..303e7a6843 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRIsReadyRequest::VRIsReadyRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,17 +56,17 @@ VRIsReadyRequest::VRIsReadyRequest( VRIsReadyRequest::~VRIsReadyRequest() {} void VRIsReadyRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); subscribe_on_event(hmi_apis::FunctionID::VR_IsReady, correlation_id()); SendRequest(); } void VRIsReadyRequest::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::VR_IsReady: { - LOG4CXX_DEBUG(logger_, "Received VR_IsReady event"); + SDL_LOG_DEBUG("Received VR_IsReady event"); unsubscribe_from_event(hmi_apis::FunctionID::VR_IsReady); const bool is_available = app_mngr::commands::ChangeInterfaceState( application_manager_, message, HmiInterfaces::HMI_INTERFACE_VR); @@ -74,8 +76,7 @@ void VRIsReadyRequest::on_event(const event_engine::Event& event) { if (!app_mngr::commands::CheckAvailabilityHMIInterfaces( application_manager_, HmiInterfaces::HMI_INTERFACE_VR)) { UpdateRequiredInterfaceCapabilitiesRequests(hmi_interface::vr); - LOG4CXX_INFO(logger_, - "HmiInterfaces::HMI_INTERFACE_VR isn't available"); + SDL_LOG_INFO("HmiInterfaces::HMI_INTERFACE_VR isn't available"); return; } @@ -83,7 +84,7 @@ void VRIsReadyRequest::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/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc index 373f97bf80..486cf32890 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc @@ -36,6 +36,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRIsReadyResponse::VRIsReadyResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -51,7 +53,7 @@ VRIsReadyResponse::VRIsReadyResponse( VRIsReadyResponse::~VRIsReadyResponse() {} void VRIsReadyResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::VR_IsReady); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc index 4257158f6a..db834f05a8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRPerformInteractionRequest::VRPerformInteractionRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ VRPerformInteractionRequest::VRPerformInteractionRequest( VRPerformInteractionRequest::~VRPerformInteractionRequest() {} void VRPerformInteractionRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendRequest(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc index 16378ab55a..2622b4f493 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + VRPerformInteractionResponse::VRPerformInteractionResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ VRPerformInteractionResponse::VRPerformInteractionResponse( VRPerformInteractionResponse::~VRPerformInteractionResponse() {} void VRPerformInteractionResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); event_engine::Event event(hmi_apis::FunctionID::VR_PerformInteraction); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc index 1dbfc97458..0267073e41 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc @@ -45,6 +45,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + namespace custom_str = utils::custom_string; AddCommandRequest::AddCommandRequest( @@ -68,7 +70,7 @@ AddCommandRequest::AddCommandRequest( AddCommandRequest::~AddCommandRequest() {} void AddCommandRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); RemoveCommand(); CommandRequestImpl::onTimeOut(); } @@ -79,13 +81,13 @@ bool AddCommandRequest::Init() { } void AddCommandRequest::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_, "No application associated with session key"); + SDL_LOG_ERROR("No application associated with session key"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -97,22 +99,22 @@ void AddCommandRequest::Run() { application_manager_); if (mobile_apis::Result::INVALID_DATA == verification_result) { - LOG4CXX_ERROR( - logger_, "MessageHelper::VerifyImage return " << verification_result); + SDL_LOG_ERROR("MessageHelper::VerifyImage return " + << verification_result); SendResponse(false, verification_result); return; } } if (!((*message_)[strings::msg_params].keyExists(strings::cmd_id))) { - LOG4CXX_ERROR(logger_, "INVALID_DATA"); + SDL_LOG_ERROR("INVALID_DATA"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } if (app->FindCommand( (*message_)[strings::msg_params][strings::cmd_id].asUInt())) { - LOG4CXX_ERROR(logger_, "INVALID_ID"); + SDL_LOG_ERROR("INVALID_ID"); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } @@ -149,13 +151,13 @@ void AddCommandRequest::Run() { } if (!data_exist) { - LOG4CXX_ERROR(logger_, "INVALID_DATA"); + SDL_LOG_ERROR("INVALID_DATA"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } if (IsWhiteSpaceExist()) { - LOG4CXX_ERROR(logger_, "Incoming add command has contains \t\n \\t \\n"); + SDL_LOG_ERROR("Incoming add command has contains \t\n \\t \\n"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -245,9 +247,9 @@ bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) { [strings::menu_name] .asString()) && (saved_parent_id == parent_id)) { - LOG4CXX_INFO(logger_, - "AddCommandRequest::CheckCommandName received" - " command name already exist in same level menu"); + SDL_LOG_INFO( + "AddCommandRequest::CheckCommandName received" + " command name already exist in same level menu"); return false; } } @@ -279,9 +281,9 @@ bool AddCommandRequest::CheckCommandVRSynonym(ApplicationConstSharedPtr app) { .asCustomString(); if (vr_cmd_i.CompareIgnoreCase(vr_cmd_j)) { - LOG4CXX_INFO(logger_, - "AddCommandRequest::CheckCommandVRSynonym" - " received command vr synonym already exist"); + SDL_LOG_INFO( + "AddCommandRequest::CheckCommandVRSynonym" + " received command vr synonym already exist"); return false; } } @@ -302,9 +304,9 @@ bool AddCommandRequest::CheckCommandParentId(ApplicationConstSharedPtr app) { smart_objects::SmartObject* parent = app->FindSubMenu(parent_id); if (!parent) { - LOG4CXX_INFO(logger_, - "AddCommandRequest::CheckCommandParentId received" - " submenu doesn't exist"); + SDL_LOG_INFO( + "AddCommandRequest::CheckCommandParentId received" + " submenu doesn't exist"); return false; } return true; @@ -312,7 +314,7 @@ bool AddCommandRequest::CheckCommandParentId(ApplicationConstSharedPtr app) { // TODO(AKUTSAN) APPLINK-26973: Refactor AddCommandRequest void AddCommandRequest::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(); @@ -321,7 +323,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } @@ -333,7 +335,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_AddCommand: { - LOG4CXX_INFO(logger_, "Received UI_AddCommand event"); + SDL_LOG_INFO("Received UI_AddCommand event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); is_ui_received_ = true; ui_result_ = static_cast<hmi_apis::Common_Result::eType>( @@ -345,7 +347,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::VR_AddCommand: { - LOG4CXX_INFO(logger_, "Received VR_AddCommand event"); + SDL_LOG_INFO("Received VR_AddCommand event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR); is_vr_received_ = true; vr_result_ = static_cast<hmi_apis::Common_Result::eType>( @@ -357,7 +359,7 @@ void AddCommandRequest::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; } } @@ -411,8 +413,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { (is_no_ui_error && is_vr_invalid_unsupported) || (is_no_vr_error && is_ui_invalid_unsupported); - LOG4CXX_DEBUG(logger_, - "calculated result " << ui_result_ << " " << is_no_ui_error + SDL_LOG_DEBUG("calculated result " << ui_result_ << " " << is_no_ui_error << " " << is_no_vr_error); const bool is_vr_or_ui_warning = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( @@ -445,7 +446,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == vr_result_) { result_code = MessageHelper::HMIToMobileResult(ui_result_); } - LOG4CXX_DEBUG(logger_, "HMIToMobileResult " << result_code); + SDL_LOG_DEBUG("HMIToMobileResult " << result_code); } if (BothSend() && hmi_apis::Common_Result::SUCCESS == vr_result_) { @@ -466,7 +467,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params); application->RemoveCommand(cmd_id); result = false; - LOG4CXX_DEBUG(logger_, "Result " << result); + SDL_LOG_DEBUG("Result " << result); } } @@ -481,7 +482,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { application->RemoveCommand(cmd_id); result = false; - LOG4CXX_DEBUG(logger_, "Result " << result); + SDL_LOG_DEBUG("Result " << result); } HmiInterfaces::InterfaceState ui_interface_state = @@ -496,12 +497,12 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { HmiInterfaces::STATE_NOT_AVAILABLE == vr_interface_state) || (is_ui_unsupported && HmiInterfaces::STATE_NOT_AVAILABLE == ui_interface_state))) { - LOG4CXX_DEBUG(logger_, "!BothSend() && is_vr_or_ui_unsupported"); + SDL_LOG_DEBUG("!BothSend() && is_vr_or_ui_unsupported"); result = false; } if (is_vr_and_ui_unsupported) { - LOG4CXX_DEBUG(logger_, "UI and VR interface both unsupported"); + SDL_LOG_DEBUG("UI and VR interface both unsupported"); result = false; } @@ -524,7 +525,7 @@ bool AddCommandRequest::IsPendingResponseExist() { } bool AddCommandRequest::IsWhiteSpaceExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) { @@ -532,7 +533,7 @@ bool AddCommandRequest::IsWhiteSpaceExist() { [strings::menu_name] .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid menu name syntax check failed."); + SDL_LOG_ERROR("Invalid menu name syntax check failed."); return true; } } @@ -545,7 +546,7 @@ bool AddCommandRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::vr_commands][i] .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed"); + SDL_LOG_ERROR("Invalid vr_commands syntax check failed"); return true; } } @@ -555,7 +556,7 @@ bool AddCommandRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::cmd_icon][strings::value] .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid cmd_icon value syntax check failed"); + SDL_LOG_ERROR("Invalid cmd_icon value syntax check failed"); return true; } } @@ -596,10 +597,10 @@ const std::string AddCommandRequest::GenerateMobileResponseInfo() { } void AddCommandRequest::RemoveCommand() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (app.use_count() == 0) { - LOG4CXX_ERROR(logger_, "No application associated with session key"); + SDL_LOG_ERROR("No application associated with session key"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc index 24ff3b5a28..6e8c589cb6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AddCommandResponse::AddCommandResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ AddCommandResponse::AddCommandResponse( AddCommandResponse::~AddCommandResponse() {} void AddCommandResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc index 71bf867054..d79cd57953 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc @@ -42,6 +42,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AddSubMenuRequest::AddSubMenuRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,12 +59,12 @@ AddSubMenuRequest::AddSubMenuRequest( AddSubMenuRequest::~AddSubMenuRequest() {} void AddSubMenuRequest::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; } @@ -77,8 +79,8 @@ void AddSubMenuRequest::Run() { received_msg_params[strings::menu_icon], app, application_manager_); if (mobile_apis::Result::INVALID_DATA == verification_result) { - LOG4CXX_ERROR( - logger_, "MessageHelper::VerifyImage return " << verification_result); + SDL_LOG_ERROR("MessageHelper::VerifyImage return " + << verification_result); SendResponse(false, verification_result); return; } @@ -86,7 +88,7 @@ void AddSubMenuRequest::Run() { const int32_t menu_id = received_msg_params[strings::menu_id].asInt(); if (app->FindSubMenu(menu_id)) { - LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found."); + SDL_LOG_ERROR("Menu with id " << menu_id << " is not found."); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } @@ -100,13 +102,13 @@ void AddSubMenuRequest::Run() { : 0; if (app->IsSubMenuNameAlreadyExist(menu_name, parent_id)) { - LOG4CXX_ERROR(logger_, "Menu name " << menu_name << " is duplicated."); + SDL_LOG_ERROR("Menu name " << menu_name << " is duplicated."); SendResponse(false, mobile_apis::Result::DUPLICATE_NAME); return; } if (!CheckSubMenuName()) { - LOG4CXX_ERROR(logger_, "Sub-menu name is not valid."); + SDL_LOG_ERROR("Sub-menu name is not valid."); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -146,7 +148,7 @@ void AddSubMenuRequest::Run() { } void AddSubMenuRequest::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()) { @@ -164,7 +166,7 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) { application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } @@ -191,7 +193,7 @@ void AddSubMenuRequest::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; } } @@ -203,12 +205,12 @@ bool AddSubMenuRequest::Init() { } bool AddSubMenuRequest::CheckSubMenuName() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; str = (*message_)[strings::msg_params][strings::menu_name].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_INFO(logger_, "Invalid subMenu name."); + SDL_LOG_INFO("Invalid subMenu name."); return false; } return true; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc index d91f13f1df..c9e8d1809f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AddSubMenuResponse::AddSubMenuResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ AddSubMenuResponse::AddSubMenuResponse( AddSubMenuResponse::~AddSubMenuResponse() {} void AddSubMenuResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc index 9f36f260ae..47b3a87d52 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc @@ -37,6 +37,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AlertManeuverRequest::AlertManeuverRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,11 +58,11 @@ AlertManeuverRequest::AlertManeuverRequest( AlertManeuverRequest::~AlertManeuverRequest() {} void AlertManeuverRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if ((!(*message_)[strings::msg_params].keyExists(strings::soft_buttons)) && (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks))) { - LOG4CXX_ERROR(logger_, "AlertManeuverRequest::Request without parameters!"); + SDL_LOG_ERROR("AlertManeuverRequest::Request without parameters!"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -69,15 +71,15 @@ void AlertManeuverRequest::Run() { (*message_)[strings::params][strings::connection_key].asUInt()); if (NULL == app.get()) { - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } if (IsWhiteSpaceExist()) { - LOG4CXX_ERROR(logger_, - "Incoming alert maneuver has contains \\t\\n \\\\t \\\\n" - "text contains only whitespace in ttsChunks"); + SDL_LOG_ERROR( + "Incoming alert maneuver has contains \\t\\n \\\\t \\\\n" + "text contains only whitespace in ttsChunks"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -91,7 +93,7 @@ void AlertManeuverRequest::Run() { application_manager_); if (mobile_apis::Result::SUCCESS != processing_result) { - LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!"); + SDL_LOG_ERROR("Wrong soft buttons parameters!"); SendResponse(false, processing_result); return; } @@ -107,9 +109,8 @@ void AlertManeuverRequest::Run() { MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR( - logger_, - "MessageHelper::VerifyTtsFiles return " << verification_result); + SDL_LOG_ERROR("MessageHelper::VerifyTtsFiles return " + << verification_result); SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, "One or more files needed for tts_chunks are not present"); @@ -154,12 +155,12 @@ void AlertManeuverRequest::Run() { } void AlertManeuverRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& message = event.smart_object(); hmi_apis::FunctionID::eType event_id = event.id(); switch (event_id) { case hmi_apis::FunctionID::Navigation_AlertManeuver: { - LOG4CXX_INFO(logger_, "Received Navigation_AlertManeuver event"); + SDL_LOG_INFO("Received Navigation_AlertManeuver event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); pending_requests_.Remove(event_id); navi_alert_maneuver_result_code_ = @@ -169,7 +170,7 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::TTS_Speak: { - LOG4CXX_INFO(logger_, "Received TTS_Speak event"); + SDL_LOG_INFO("Received TTS_Speak event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); pending_requests_.Remove(event_id); tts_speak_result_code_ = static_cast<hmi_apis::Common_Result::eType>( @@ -178,24 +179,24 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::TTS_OnResetTimeout: { - LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event"); + SDL_LOG_INFO("Received TTS_OnResetTimeout event"); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); break; } default: { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SDL_LOG_ERROR("Received unknown event " << event.id()); SendResponse( - false, mobile_apis::Result::INVALID_ENUM, "Received unknown event"); + false, mobile_apis::Result::INVALID_ENUM, "Received unknown event "); return; } } if (!pending_requests_.IsFinal(event_id)) { - LOG4CXX_DEBUG(logger_, - "There are some pending responses from HMI." - "AlertManeuverRequest still waiting."); + SDL_LOG_DEBUG( + "There are some pending responses from HMI. " + "AlertManeuverRequest still waiting."); return; } std::string return_info; @@ -214,7 +215,7 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { bool AlertManeuverRequest::PrepareResponseParameters( mobile_apis::Result::eType& result_code, std::string& return_info) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace helpers; app_mngr::commands::ResponseInfo navigation_alert_info( @@ -246,7 +247,7 @@ bool AlertManeuverRequest::PrepareResponseParameters( } bool AlertManeuverRequest::IsWhiteSpaceExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using smart_objects::SmartArray; if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) { @@ -258,7 +259,7 @@ bool AlertManeuverRequest::IsWhiteSpaceExist() { for (; it_tts_chunk != tts_chunks_arr->end(); ++it_tts_chunk) { const char* tts_chunk_text = (*it_tts_chunk)[strings::text].asCharArray(); if (strlen(tts_chunk_text) && !CheckSyntax(tts_chunk_text)) { - LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed"); + SDL_LOG_ERROR("Invalid tts_chunks syntax check failed"); return true; } } @@ -277,7 +278,7 @@ bool AlertManeuverRequest::IsWhiteSpaceExist() { const char* soft_button_text = (*it_soft_button)[strings::text].asCharArray(); if (!CheckSyntax(soft_button_text)) { - LOG4CXX_ERROR(logger_, "Invalid soft_buttons syntax check failed"); + SDL_LOG_ERROR("Invalid soft_buttons syntax check failed"); return true; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc index 97c93d7455..993dc75548 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AlertManeuverResponse::AlertManeuverResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ AlertManeuverResponse::AlertManeuverResponse( AlertManeuverResponse::~AlertManeuverResponse() {} void AlertManeuverResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc index a0544ee444..55783be4cd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc @@ -47,6 +47,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AlertRequest::AlertRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -81,9 +83,9 @@ bool AlertRequest::Init() { // If soft buttons are present, SDL will not use initiate timeout tracking for // response. if (msg_params.keyExists(strings::soft_buttons)) { - LOG4CXX_INFO(logger_, - "Request contains soft buttons - request timeout " - "will be set to 0."); + SDL_LOG_INFO( + "Request contains soft buttons - request timeout " + "will be set to 0."); default_timeout_ = 0; } @@ -91,7 +93,7 @@ bool AlertRequest::Init() { } void AlertRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); uint32_t app_id = (*message_)[strings::params][strings::connection_key].asInt(); @@ -122,24 +124,24 @@ void AlertRequest::Run() { } void AlertRequest::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::TTS_OnResetTimeout: case hmi_apis::FunctionID::UI_OnResetTimeout: { - LOG4CXX_INFO(logger_, - "Received UI_OnResetTimeout event " - " or TTS_OnResetTimeout event" - << awaiting_tts_speak_response_ << " " - << awaiting_tts_stop_speaking_response_ << " " - << awaiting_ui_alert_response_); + SDL_LOG_INFO( + "Received UI_OnResetTimeout event " + " or TTS_OnResetTimeout event " + << awaiting_tts_speak_response_ << " " + << awaiting_tts_stop_speaking_response_ << " " + << awaiting_ui_alert_response_); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); break; } case hmi_apis::FunctionID::UI_Alert: { - LOG4CXX_INFO(logger_, "Received UI_Alert event"); + SDL_LOG_INFO("Received UI_Alert event"); // Unsubscribe from event to avoid unwanted messages EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); unsubscribe_from_event(hmi_apis::FunctionID::UI_Alert); @@ -163,7 +165,7 @@ void AlertRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::TTS_Speak: { - LOG4CXX_INFO(logger_, "Received TTS_Speak event"); + SDL_LOG_INFO("Received TTS_Speak event"); // Unsubscribe from event to avoid unwanted messages EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); unsubscribe_from_event(hmi_apis::FunctionID::TTS_Speak); @@ -174,7 +176,7 @@ void AlertRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::TTS_StopSpeaking: { - LOG4CXX_INFO(logger_, "Received TTS_StopSpeaking event"); + SDL_LOG_INFO("Received TTS_StopSpeaking event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); // Unsubscribe from event to avoid unwanted messages unsubscribe_from_event(hmi_apis::FunctionID::TTS_StopSpeaking); @@ -182,7 +184,7 @@ void AlertRequest::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; } } @@ -238,11 +240,11 @@ bool AlertRequest::PrepareResponseParameters( } bool AlertRequest::Validate(uint32_t app_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(app_id); if (!app) { - LOG4CXX_ERROR(logger_, "No application associated with session key"); + SDL_LOG_ERROR("No application associated with session key"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return false; } @@ -252,7 +254,7 @@ bool AlertRequest::Validate(uint32_t app_id) { app->AreCommandLimitsExceeded( static_cast<mobile_apis::FunctionID::eType>(function_id()), application_manager::TLimitSource::POLICY_TABLE)) { - LOG4CXX_ERROR(logger_, "Alert frequency is too high."); + SDL_LOG_ERROR("Alert frequency is too high."); SendResponse(false, mobile_apis::Result::REJECTED); return false; } @@ -271,7 +273,7 @@ bool AlertRequest::Validate(uint32_t app_id) { application_manager_); if (mobile_apis::Result::SUCCESS != processing_result) { - LOG4CXX_ERROR(logger_, "INVALID_DATA!"); + SDL_LOG_ERROR("INVALID_DATA!"); SendResponse(false, processing_result); return false; } @@ -281,7 +283,7 @@ bool AlertRequest::Validate(uint32_t app_id) { (!(*message_)[strings::msg_params].keyExists(strings::alert_text2)) && (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks) && (1 > (*message_)[strings::msg_params][strings::tts_chunks].length()))) { - LOG4CXX_ERROR(logger_, "Mandatory parameters are missing"); + SDL_LOG_ERROR("Mandatory parameters are missing"); SendResponse(false, mobile_apis::Result::INVALID_DATA, "Mandatory parameters are missing"); @@ -295,9 +297,8 @@ bool AlertRequest::Validate(uint32_t app_id) { MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR( - logger_, - "MessageHelper::VerifyTtsFiles return " << verification_result); + SDL_LOG_ERROR("MessageHelper::VerifyTtsFiles return " + << verification_result); SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, "One or more files needed for tts_chunks are not present"); @@ -309,7 +310,7 @@ bool AlertRequest::Validate(uint32_t app_id) { } void AlertRequest::SendAlertRequest(int32_t app_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(app_id); smart_objects::SmartObject msg_params = @@ -364,7 +365,7 @@ void AlertRequest::SendAlertRequest(int32_t app_id) { application_manager_); if (mobile_apis::Result::INVALID_DATA == verification_result) { - LOG4CXX_ERROR(logger_, "Image verification failed."); + SDL_LOG_ERROR("Image verification failed."); SendResponse(false, verification_result); return; } @@ -401,7 +402,7 @@ void AlertRequest::SendAlertRequest(int32_t app_id) { void AlertRequest::SendSpeakRequest(int32_t app_id, bool tts_chunks_exists, size_t length_tts_chunks) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace hmi_apis; using namespace smart_objects; // crate HMI speak request @@ -423,13 +424,13 @@ void AlertRequest::SendSpeakRequest(int32_t app_id, } bool AlertRequest::CheckStrings() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) { str = (*message_)[strings::msg_params][strings::alert_text1].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid alert_text_1 syntax check failed"); + SDL_LOG_ERROR("Invalid alert_text_1 syntax check failed"); return false; } } @@ -437,7 +438,7 @@ bool AlertRequest::CheckStrings() { if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) { str = (*message_)[strings::msg_params][strings::alert_text2].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid alert_text_2 syntax check failed"); + SDL_LOG_ERROR("Invalid alert_text_2 syntax check failed"); return false; } } @@ -445,7 +446,7 @@ bool AlertRequest::CheckStrings() { if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) { str = (*message_)[strings::msg_params][strings::alert_text3].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid alert_text_3 syntax check failed"); + SDL_LOG_ERROR("Invalid alert_text_3 syntax check failed"); return false; } } @@ -456,7 +457,7 @@ bool AlertRequest::CheckStrings() { for (size_t i = 0; i < tts_chunks_array.length(); ++i) { str = tts_chunks_array[i][strings::text].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid tts_chunks text syntax check failed"); + SDL_LOG_ERROR("Invalid tts_chunks text syntax check failed"); return false; } } @@ -465,7 +466,7 @@ bool AlertRequest::CheckStrings() { } bool AlertRequest::HasHmiResponsesToWait() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); return awaiting_ui_alert_response_ || awaiting_tts_speak_response_ || awaiting_tts_stop_speaking_response_; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc index b709d13958..1b8eebe7d7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc @@ -42,6 +42,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + AlertResponse::AlertResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,7 +59,7 @@ AlertResponse::AlertResponse( AlertResponse::~AlertResponse() {} void AlertResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_request.cc index 6873cb7bf1..27020f2719 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_request.cc @@ -41,6 +41,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + CancelInteractionRequest::CancelInteractionRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ CancelInteractionRequest::CancelInteractionRequest( CancelInteractionRequest::~CancelInteractionRequest() {} void CancelInteractionRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto function_id = static_cast<mobile_apis::FunctionID::eType>( (*message_)[strings::msg_params][strings::func_id].asInt()); @@ -69,7 +71,7 @@ void CancelInteractionRequest::Run() { mobile_apis::FunctionID::SubtleAlertID, mobile_apis::FunctionID::ScrollableMessageID, mobile_apis::FunctionID::SliderID)) { - LOG4CXX_ERROR(logger_, "Bad function ID" << function_id); + SDL_LOG_ERROR("Bad function ID " << function_id); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } @@ -87,10 +89,10 @@ void CancelInteractionRequest::Run() { } void CancelInteractionRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (event.id() != hmi_apis::FunctionID::UI_CancelInteraction) { - 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/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_response.cc index af73e72a6f..9adec06c9f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/cancel_interaction_response.cc @@ -37,6 +37,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + CancelInteractionResponse::CancelInteractionResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,9 +54,9 @@ CancelInteractionResponse::CancelInteractionResponse( CancelInteractionResponse::~CancelInteractionResponse() {} void CancelInteractionResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } } // namespace commands -} // namespace sdl_rpc_plugin
\ No newline at end of file +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc index 27cac83fad..8e13110515 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc @@ -59,6 +59,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ChangeRegistrationRequest::ChangeRegistrationRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -144,19 +146,18 @@ void ChangeRegistrationRequest::SendUIRequest( } void ChangeRegistrationRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace smart_objects; 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; } if (IsWhiteSpaceExist()) { - LOG4CXX_INFO(logger_, - "Incoming request contains \t\n \\t \\n or whitespace"); + SDL_LOG_INFO("Incoming request contains \t\n \\t \\n or whitespace"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -176,14 +177,14 @@ void ChangeRegistrationRequest::Run() { if (false == (IsLanguageSupportedByUI(hmi_language) && IsLanguageSupportedByVR(language) && IsLanguageSupportedByTTS(language))) { - LOG4CXX_ERROR(logger_, "Language is not supported"); + SDL_LOG_ERROR("Language is not supported"); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); return; } if (msg_params.keyExists(strings::app_name) && !IsNicknameAllowed(msg_params[strings::app_name].asCustomString())) { - LOG4CXX_ERROR(logger_, "Nickname is not allowed."); + SDL_LOG_ERROR("Nickname is not allowed."); SendResponse(false, mobile_apis::Result::DISALLOWED); return; } @@ -195,9 +196,8 @@ void ChangeRegistrationRequest::Run() { MessageHelper::VerifyTtsFiles(tts_name, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR( - logger_, - "MessageHelper::VerifyTtsFiles return " << verification_result); + SDL_LOG_ERROR("MessageHelper::VerifyTtsFiles return " + << verification_result); SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, "One or more files needed for tts_name are not present"); @@ -244,14 +244,14 @@ void ChangeRegistrationRequest::Run() { } void ChangeRegistrationRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& message = event.smart_object(); hmi_apis::FunctionID::eType event_id = event.id(); switch (event_id) { case hmi_apis::FunctionID::UI_ChangeRegistration: { - LOG4CXX_INFO(logger_, "Received UI_ChangeRegistration event"); + SDL_LOG_INFO("Received UI_ChangeRegistration event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); pending_requests_.Remove(event_id); ui_result_ = static_cast<hmi_apis::Common_Result::eType>( @@ -260,7 +260,7 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::VR_ChangeRegistration: { - LOG4CXX_INFO(logger_, "Received VR_ChangeRegistration event"); + SDL_LOG_INFO("Received VR_ChangeRegistration event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR); pending_requests_.Remove(event_id); vr_result_ = static_cast<hmi_apis::Common_Result::eType>( @@ -269,7 +269,7 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::TTS_ChangeRegistration: { - LOG4CXX_INFO(logger_, "Received TTS_ChangeRegistration event"); + SDL_LOG_INFO("Received TTS_ChangeRegistration event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); pending_requests_.Remove(event_id); tts_result_ = static_cast<hmi_apis::Common_Result::eType>( @@ -278,7 +278,7 @@ void ChangeRegistrationRequest::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; } } @@ -288,7 +288,7 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) { application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } @@ -315,9 +315,9 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) { response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); } else { - LOG4CXX_INFO(logger_, - "There are some pending responses from HMI." - "ChangeRegistrationRequest still waiting."); + SDL_LOG_INFO( + "There are some pending responses from HMI." + "ChangeRegistrationRequest still waiting."); } } @@ -331,7 +331,7 @@ void CheckInfo(std::string& str) { bool ChangeRegistrationRequest::PrepareResponseParameters( mobile_apis::Result::eType& result_code, std::string& response_info) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace helpers; const bool is_tts_succeeded_unsupported = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( @@ -463,7 +463,7 @@ bool ChangeRegistrationRequest::IsLanguageSupportedByUI( const auto ui_languages = hmi_capabilities.ui_supported_languages(); if (!ui_languages) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return false; } @@ -473,7 +473,7 @@ bool ChangeRegistrationRequest::IsLanguageSupportedByUI( } } - LOG4CXX_ERROR(logger_, "Language isn't supported by UI"); + SDL_LOG_ERROR("Language isn't supported by UI"); return false; } @@ -484,7 +484,7 @@ bool ChangeRegistrationRequest::IsLanguageSupportedByVR( const auto vr_languages = hmi_capabilities.vr_supported_languages(); if (!vr_languages) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return false; } @@ -494,7 +494,7 @@ bool ChangeRegistrationRequest::IsLanguageSupportedByVR( } } - LOG4CXX_ERROR(logger_, "Language isn't supported by VR"); + SDL_LOG_ERROR("Language isn't supported by VR"); return false; } @@ -505,7 +505,7 @@ bool ChangeRegistrationRequest::IsLanguageSupportedByTTS( const auto tts_languages = hmi_capabilities.tts_supported_languages(); if (!tts_languages) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return false; } @@ -516,7 +516,7 @@ bool ChangeRegistrationRequest::IsLanguageSupportedByTTS( } } - LOG4CXX_ERROR(logger_, "Language isn't supported by TTS"); + SDL_LOG_ERROR("Language isn't supported by TTS"); return false; } @@ -526,7 +526,7 @@ bool ChangeRegistrationRequest::IsWhiteSpaceExist() { if ((*message_)[strings::msg_params].keyExists(strings::app_name)) { str = (*message_)[strings::msg_params][strings::app_name].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed"); + SDL_LOG_ERROR("Invalid app_name syntax check failed"); return true; } } @@ -541,7 +541,7 @@ bool ChangeRegistrationRequest::IsWhiteSpaceExist() { for (; it_tn != it_tn_end; ++it_tn) { str = (*it_tn)[strings::text].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed"); + SDL_LOG_ERROR("Invalid tts_name syntax check failed"); return true; } } @@ -552,8 +552,7 @@ bool ChangeRegistrationRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::ngn_media_screen_app_name] .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid ngn_media_screen_app_name syntax check failed"); + SDL_LOG_ERROR("Invalid ngn_media_screen_app_name syntax check failed"); return true; } } @@ -568,7 +567,7 @@ bool ChangeRegistrationRequest::IsWhiteSpaceExist() { for (; it_vs != it_vs_end; ++it_vs) { str = (*it_vs).asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed"); + SDL_LOG_ERROR("Invalid vr_synonyms syntax check failed"); return true; } } @@ -578,7 +577,7 @@ bool ChangeRegistrationRequest::IsWhiteSpaceExist() { mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence( const connection_handler::DeviceHandle& device_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; @@ -610,7 +609,7 @@ mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence( const auto& cur_name = app->name(); if (msg_params.keyExists(strings::app_name)) { if (app_name.CompareIgnoreCase(cur_name)) { - LOG4CXX_ERROR(logger_, "Application name is known already."); + SDL_LOG_ERROR("Application name is known already."); return mobile_apis::Result::DUPLICATE_NAME; } const auto vr = app->vr_synonyms(); @@ -619,7 +618,7 @@ mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence( CoincidencePredicateVR v(app_name); if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) { - LOG4CXX_ERROR(logger_, "Application name is known already."); + SDL_LOG_ERROR("Application name is known already."); return mobile_apis::Result::DUPLICATE_NAME; } } @@ -631,7 +630,7 @@ mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence( CoincidencePredicateVR v(cur_name); if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) { - LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name ."); + SDL_LOG_ERROR("vr_synonyms duplicated with app_name ."); return mobile_apis::Result::DUPLICATE_NAME; } } // End vr check @@ -646,11 +645,9 @@ mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence( tts_curr->end(), compare_tts_name); if (it_tts != tts_array->end()) { - LOG4CXX_ERROR( - logger_, - "TTS name: " - << (*it_tts)[strings::text].asCustomString().AsMBString() - << " is known already"); + SDL_LOG_ERROR("TTS name: " + << (*it_tts)[strings::text].asCustomString().AsMBString() + << " is known already"); return mobile_apis::Result::DUPLICATE_NAME; } } // End tts check @@ -661,13 +658,12 @@ mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence( bool ChangeRegistrationRequest::IsNicknameAllowed( const custom_str::CustomString& app_name) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR( - logger_, - "Can't find appication with connection key " << connection_key()); + SDL_LOG_ERROR("Can't find appication with connection key " + << connection_key()); return false; } @@ -680,9 +676,8 @@ bool ChangeRegistrationRequest::IsNicknameAllowed( policy_app_id, &app_nicknames, &app_hmi_types); if (!init_result) { - LOG4CXX_ERROR(logger_, - "Error during getting of nickname list for application " - << policy_app_id); + SDL_LOG_ERROR("Error during getting of nickname list for application " + << policy_app_id); return false; } @@ -691,8 +686,7 @@ bool ChangeRegistrationRequest::IsNicknameAllowed( policy::StringArray::const_iterator it = std::find_if(app_nicknames.begin(), app_nicknames.end(), compare); if (app_nicknames.end() == it) { - LOG4CXX_WARN(logger_, - "Application name was not found in nicknames list."); + SDL_LOG_WARN("Application name was not found in nicknames list."); usage_statistics::AppCounter count_of_rejections_nickname_mismatch( policy_handler_.GetStatisticManager(), diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc index 78c60bc746..58bf5f4caa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ChangeRegistrationResponse::ChangeRegistrationResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ ChangeRegistrationResponse::ChangeRegistrationResponse( ChangeRegistrationResponse::~ChangeRegistrationResponse() {} void ChangeRegistrationResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc index 275f1d82a6..b4a09844f2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc @@ -39,6 +39,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + CloseApplicationRequest::CloseApplicationRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,11 +56,11 @@ CloseApplicationRequest::CloseApplicationRequest( CloseApplicationRequest::~CloseApplicationRequest() {} void CloseApplicationRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (app.use_count() == 0) { - LOG4CXX_ERROR(logger_, "Application does not exist"); + SDL_LOG_ERROR("Application does not exist"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -71,7 +73,7 @@ void CloseApplicationRequest::Run() { } void CloseApplicationRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& message = event.smart_object(); auto msg_params = message[strings::msg_params]; @@ -89,7 +91,7 @@ void CloseApplicationRequest::on_event(const event_engine::Event& event) { application_manager_.application(connection_key()); if (app.use_count() == 0) { - LOG4CXX_ERROR(logger_, "Application does not exist"); + SDL_LOG_ERROR("Application does not exist"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc index 934804e1b1..a03c7a64f4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc @@ -38,6 +38,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + CloseApplicationResponse::CloseApplicationResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ CloseApplicationResponse::CloseApplicationResponse( CloseApplicationResponse::~CloseApplicationResponse() {} void CloseApplicationResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc index 258aefd63f..6b7e1d917d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc @@ -47,6 +47,8 @@ const char* kInvalidImageWarningInfo = "Requested image(s) not found."; namespace sdl_rpc_plugin { namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + using namespace application_manager; CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest( @@ -68,16 +70,16 @@ CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest( , is_timed_out_(false) {} CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } void CreateInteractionChoiceSetRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace mobile_apis; 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; } @@ -105,7 +107,7 @@ void CreateInteractionChoiceSetRequest::Run() { } if (verification_result_image == Result::INVALID_DATA || verification_result_secondary_image == Result::INVALID_DATA) { - LOG4CXX_ERROR(logger_, "Image verification failed."); + SDL_LOG_ERROR("Image verification failed."); SendResponse(false, Result::INVALID_DATA); return; } else if (verification_result_image == Result::WARNINGS || @@ -120,8 +122,7 @@ void CreateInteractionChoiceSetRequest::Run() { .asInt(); if (app->FindChoiceSet(choice_set_id_)) { - LOG4CXX_ERROR(logger_, - "Choice set with id " << choice_set_id_ << " is not found."); + SDL_LOG_ERROR("Choice set with id " << choice_set_id_ << " is not found."); SendResponse(false, Result::INVALID_ID); return; } @@ -160,7 +161,7 @@ void CreateInteractionChoiceSetRequest::Run() { mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet( ApplicationConstSharedPtr app) { using namespace smart_objects; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::set<uint32_t> choice_id_set; @@ -175,15 +176,14 @@ mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet( choice_id_set.insert( (*current_choice_set_it)[strings::choice_id].asInt()); if (!ins_res.second) { - LOG4CXX_ERROR(logger_, - "Choice with ID " - << (*current_choice_set_it)[strings::choice_id].asInt() - << " already exists"); + SDL_LOG_ERROR("Choice with ID " + << (*current_choice_set_it)[strings::choice_id].asInt() + << " already exists"); return mobile_apis::Result::INVALID_ID; } if (IsWhiteSpaceExist(*current_choice_set_it)) { - LOG4CXX_ERROR(logger_, "Incoming choice set has contains \t\n \\t \\n"); + SDL_LOG_ERROR("Incoming choice set has contains \t\n \\t \\n"); return mobile_apis::Result::INVALID_DATA; } for (next_choice_set_it = current_choice_set_it + 1; @@ -218,9 +218,8 @@ bool CreateInteractionChoiceSetRequest::compareSynonyms( CreateInteractionChoiceSetRequest::compareStr); if (it != vr_cmds_1->end()) { - LOG4CXX_INFO( - logger_, - "Incoming choice set has duplicated VR synonyms " << it->asString()); + SDL_LOG_INFO("Incoming choice set has duplicated VR synonyms " + << it->asString()); return true; } @@ -235,19 +234,19 @@ bool CreateInteractionChoiceSetRequest::compareStr( bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist( const smart_objects::SmartObject& choice_set) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; str = choice_set[strings::menu_name].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid menu_name syntax check failed"); + SDL_LOG_ERROR("Invalid menu_name syntax check failed"); return true; } if (choice_set.keyExists(strings::secondary_text)) { str = choice_set[strings::secondary_text].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid secondary_text syntax check failed"); + SDL_LOG_ERROR("Invalid secondary_text syntax check failed"); return true; } } @@ -255,7 +254,7 @@ bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist( if (choice_set.keyExists(strings::tertiary_text)) { str = choice_set[strings::tertiary_text].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid tertiary_text syntax check failed"); + SDL_LOG_ERROR("Invalid tertiary_text syntax check failed"); return true; } } @@ -266,7 +265,7 @@ bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist( for (size_t i = 0; i < len; ++i) { str = choice_set[strings::vr_commands][i].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed"); + SDL_LOG_ERROR("Invalid vr_commands syntax check failed"); return true; } } @@ -275,7 +274,7 @@ bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist( if (choice_set.keyExists(strings::image)) { str = choice_set[strings::image][strings::value].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid image value syntax check failed"); + SDL_LOG_ERROR("Invalid image value syntax check failed"); return true; } } @@ -283,9 +282,9 @@ bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist( if (choice_set.keyExists(strings::secondary_image)) { str = choice_set[strings::secondary_image][strings::value].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid secondary_image value. " - "Syntax check failed"); + SDL_LOG_ERROR( + "Invalid secondary_image value. " + "Syntax check failed"); return true; } } @@ -294,7 +293,7 @@ bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist( void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests( application_manager::ApplicationSharedPtr const app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject& choice_set = (*message_)[strings::msg_params]; smart_objects::SmartObject msg_params = @@ -311,8 +310,7 @@ void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests( { sync_primitives::AutoLock error_lock(error_from_hmi_lock_); if (error_from_hmi_) { - LOG4CXX_WARN(logger_, - "Error from HMI received. Stop sending VRCommands"); + SDL_LOG_WARN("Error from HMI received. Stop sending VRCommands"); break; } } @@ -332,19 +330,17 @@ void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests( VRCommandInfo vr_command(vr_cmd_id); sent_commands_map_[vr_corr_id] = vr_command; - LOG4CXX_DEBUG( - logger_, - "VR_command sent corr_id " << vr_corr_id << " cmd_id " << vr_corr_id); + SDL_LOG_DEBUG("VR_command sent corr_id " << vr_corr_id << " cmd_id " + << vr_corr_id); } expected_chs_count_ = chs_num; - LOG4CXX_DEBUG(logger_, "expected_chs_count_ = " << expected_chs_count_); + SDL_LOG_DEBUG("expected_chs_count_ = " << expected_chs_count_); } void CreateInteractionChoiceSetRequest::ProcessHmiError( const hmi_apis::Common_Result::eType vr_result) { - LOG4CXX_DEBUG(logger_, - "Hmi response is not Success: " - << vr_result << ". Stop sending VRAddCommand requests"); + SDL_LOG_DEBUG("Hmi response is not Success: " + << vr_result << ". Stop sending VRAddCommand requests"); if (!error_from_hmi_) { error_from_hmi_ = true; std::string info = @@ -359,7 +355,7 @@ bool CreateInteractionChoiceSetRequest::ProcessSuccesfulHMIResponse( const uint32_t corr_id) { SentCommandsMap::iterator it = sent_commands_map_.find(corr_id); if (sent_commands_map_.end() == it) { - LOG4CXX_WARN(logger_, "HMI response for unknown VR command received"); + SDL_LOG_WARN("HMI response for unknown VR command received"); return false; } VRCommandInfo& vr_command = it->second; @@ -369,14 +365,13 @@ bool CreateInteractionChoiceSetRequest::ProcessSuccesfulHMIResponse( void CreateInteractionChoiceSetRequest::CountReceivedVRResponses() { received_chs_count_++; - LOG4CXX_DEBUG(logger_, - "Got VR.AddCommand response, there are " - << expected_chs_count_ - received_chs_count_ - << " more to wait."); + SDL_LOG_DEBUG("Got VR.AddCommand response, there are " + << expected_chs_count_ - received_chs_count_ + << " more to wait."); if (received_chs_count_ < expected_chs_count_) { application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); - LOG4CXX_DEBUG(logger_, "Timeout for request was updated"); + SDL_LOG_DEBUG("Timeout for request was updated"); } else { OnAllHMIResponsesReceived(); } @@ -386,7 +381,7 @@ void CreateInteractionChoiceSetRequest::on_event( const event_engine::Event& event) { using namespace hmi_apis; using namespace helpers; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& message = event.smart_object(); const Common_Result::eType result = static_cast<Common_Result::eType>( @@ -412,7 +407,7 @@ void CreateInteractionChoiceSetRequest::on_event( } void CreateInteractionChoiceSetRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!error_from_hmi_) { SendResponse(false, mobile_apis::Result::GENERIC_ERROR); @@ -434,12 +429,12 @@ bool CreateInteractionChoiceSetRequest::Init() { } void CreateInteractionChoiceSetRequest::DeleteChoices() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr application = application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } application->RemoveChoiceSet(choice_set_id_); @@ -455,16 +450,15 @@ void CreateInteractionChoiceSetRequest::DeleteChoices() { msg_param[strings::cmd_id] = vr_command_info.cmd_id_; SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_param); } else { - LOG4CXX_WARN(logger_, - "succesful response has not been received for cmd_id = " - << vr_command_info.cmd_id_); + SDL_LOG_WARN("succesful response has not been received for cmd_id = " + << vr_command_info.cmd_id_); } } sent_commands_map_.clear(); } void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!error_from_hmi_ && should_send_warnings_) { SendResponse(true, mobile_apis::Result::WARNINGS, kInvalidImageWarningInfo); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc index 43dba2f238..5b274adeb3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + CreateInteractionChoiceSetResponse::CreateInteractionChoiceSetResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,12 +58,12 @@ CreateInteractionChoiceSetResponse::CreateInteractionChoiceSetResponse( CreateInteractionChoiceSetResponse::~CreateInteractionChoiceSetResponse() {} void CreateInteractionChoiceSetResponse::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; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc index b69b0ee801..2a0ca4ddb3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_request.cc @@ -45,6 +45,8 @@ using app_mngr::ApplicationSharedPtr; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + CreateWindowRequest::CreateWindowRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -64,17 +66,15 @@ bool CreateWindowRequest::CheckWindowName( const app_mngr::WindowID window_id, const std::string& window_name) const { if (mobile_apis::PredefinedWindows::PRIMARY_WIDGET == window_id) { - LOG4CXX_DEBUG(logger_, - "Window name check is ignored for the primary widgets"); + SDL_LOG_DEBUG("Window name check is ignored for the primary widgets"); return true; } const bool names_are_equal = window_name == app->name().c_str(); if (names_are_equal && mobile_apis::PredefinedWindows::DEFAULT_WINDOW != window_id) { - LOG4CXX_ERROR(logger_, - "Regular widget can't have the same name as application: " - << window_name); + SDL_LOG_ERROR("Regular widget can't have the same name as application: " + << window_name); return false; } @@ -132,12 +132,12 @@ app_mngr::WindowID CreateWindowRequest::window_id() const { } void CreateWindowRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto application = application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -145,8 +145,7 @@ void CreateWindowRequest::Run() { const auto window_id = (*message_)[strings::msg_params][strings::window_id].asInt(); if (application->WindowIdExists(window_id)) { - LOG4CXX_ERROR(logger_, - "Window with id #" << window_id << " does already exist"); + SDL_LOG_ERROR("Window with id #" << window_id << " does already exist"); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } @@ -155,7 +154,7 @@ void CreateWindowRequest::Run() { (*message_)[strings::msg_params][strings::window_type].asInt(); if (mobile_apis::WindowType::eType::MAIN == window_type) { - LOG4CXX_ERROR(logger_, "MAIN application window already exists"); + SDL_LOG_ERROR("MAIN application window already exists"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -167,8 +166,7 @@ void CreateWindowRequest::Run() { [strings::duplicate_updates_from_window_id] .asInt(); if (!application->WindowIdExists(duplicate_updates_from_window_id)) { - LOG4CXX_ERROR(logger_, - "Window with id #" << duplicate_updates_from_window_id + SDL_LOG_ERROR("Window with id #" << duplicate_updates_from_window_id << " does not exist"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; @@ -178,8 +176,7 @@ void CreateWindowRequest::Run() { const std::string window_name = (*message_)[strings::msg_params][strings::window_name].asString(); if (!CheckWindowName(application, window_id, window_name)) { - LOG4CXX_ERROR(logger_, - "Window name \"" << window_name + SDL_LOG_ERROR("Window name \"" << window_name << "\" is disallowed for window #" << window_id); SendResponse(false, mobile_apis::Result::DUPLICATE_NAME); @@ -198,22 +195,22 @@ void CreateWindowRequest::Run() { } void CreateWindowRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (hmi_apis::FunctionID::UI_CreateWindow != event.id()) { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SDL_LOG_ERROR("Received unknown event " << event.id()); return; } auto application = application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } - LOG4CXX_INFO(logger_, "Received CreateWindow event"); + SDL_LOG_INFO("Received CreateWindow event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); const smart_objects::SmartObject& response_message = event.smart_object(); @@ -226,7 +223,7 @@ void CreateWindowRequest::on_event(const event_engine::Event& event) { GetInfo(response_message, response_info); if (!is_success) { - LOG4CXX_ERROR(logger_, "CreateWindow request has failed on HMI side"); + SDL_LOG_ERROR("CreateWindow request has failed on HMI side"); SendResponse(is_success, result_code, response_info.empty() ? nullptr : response_info.c_str()); @@ -247,7 +244,7 @@ bool CreateWindowRequest::Init() { bool CreateWindowRequest::IsWindowForAssociatedServiceCreated( app_mngr::ApplicationSharedPtr app) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto window_optional_params_map = app->window_optional_params_map().GetData(); @@ -266,8 +263,7 @@ bool CreateWindowRequest::IsWindowForAssociatedServiceCreated( window_optional_params_map.end(), [&associated_service_type]( const std::pair<WindowID, smart_objects::SmartObjectSPtr>& element) { - LOG4CXX_DEBUG(logger_, - "Searching for " << associated_service_type + SDL_LOG_DEBUG("Searching for " << associated_service_type << " in window info for id " << element.first); if (element.second->keyExists(strings::associated_service_type) && @@ -285,7 +281,7 @@ bool CreateWindowRequest::IsWindowForAssociatedServiceCreated( bool CreateWindowRequest::DoesExceedMaxAllowedWindows( app_mngr::ApplicationSharedPtr app) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto get_current_number_of_windows = [&app](const mobile_apis::WindowType::eType window_type) -> size_t { @@ -298,7 +294,7 @@ bool CreateWindowRequest::DoesExceedMaxAllowedWindows( } default: { - LOG4CXX_WARN(logger_, "Unknown window type"); + SDL_LOG_WARN("Unknown window type"); return 0u; } } @@ -313,7 +309,7 @@ bool CreateWindowRequest::DoesExceedMaxAllowedWindows( } if (!display_capabilities) { - LOG4CXX_WARN(logger_, "Application has no capabilities"); + SDL_LOG_WARN("Application has no capabilities"); return false; } @@ -337,7 +333,7 @@ bool CreateWindowRequest::DoesExceedMaxAllowedWindows( }); if (find_res == windowTypeSupported->end()) { - LOG4CXX_WARN(logger_, "Requested Window Type is not supported by the HMI"); + SDL_LOG_WARN("Requested Window Type is not supported by the HMI"); return true; } @@ -351,11 +347,11 @@ bool CreateWindowRequest::DoesExceedMaxAllowedWindows( bool CreateWindowRequest::ValidateWindowCreation( app_mngr::ApplicationSharedPtr app, const WindowID window_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (DoesExceedMaxAllowedWindows(app)) { std::string info("Maximum allowed amount of windows is exceeded"); - LOG4CXX_WARN(logger_, info); + SDL_LOG_WARN(info); SendResponse(false, mobile_apis::Result::REJECTED, info.c_str()); return false; } @@ -363,7 +359,7 @@ bool CreateWindowRequest::ValidateWindowCreation( if (IsWindowForAssociatedServiceCreated(app)) { std::string info( "Window for this associated service type is already created"); - LOG4CXX_WARN(logger_, info); + SDL_LOG_WARN(info); SendResponse(false, mobile_apis::Result::REJECTED, info.c_str()); return false; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_response.cc index 0d9bbc2815..830539b355 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_window_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + CreateWindowResponse::CreateWindowResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ CreateWindowResponse::CreateWindowResponse( CreateWindowResponse::~CreateWindowResponse() {} void CreateWindowResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc index 363b14f92f..6b6f500602 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc @@ -44,6 +44,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DeleteCommandRequest::DeleteCommandRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -65,13 +67,13 @@ DeleteCommandRequest::DeleteCommandRequest( DeleteCommandRequest::~DeleteCommandRequest() {} void DeleteCommandRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr application = application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -82,7 +84,7 @@ void DeleteCommandRequest::Run() { smart_objects::SmartObject* command = application->FindCommand(cmd_id); if (!command) { - LOG4CXX_ERROR(logger_, "Command with id " << cmd_id << " is not found."); + SDL_LOG_ERROR("Command with id " << cmd_id << " is not found."); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } @@ -142,17 +144,17 @@ bool DeleteCommandRequest::PrepareResponseParameters( ui_delete_info, ui_info_, vr_delete_info, vr_info_); if (is_vr_or_ui_warning && !ui_delete_info.is_unsupported_resource && !vr_delete_info.is_unsupported_resource) { - LOG4CXX_DEBUG(logger_, "VR or UI result is warning"); + SDL_LOG_DEBUG("VR or UI result is warning"); result_code = mobile_apis::Result::WARNINGS; return result; } result_code = PrepareResultCodeForResponse(ui_delete_info, vr_delete_info); - LOG4CXX_DEBUG(logger_, "Result is " << (result ? "true" : "false")); + SDL_LOG_DEBUG("Result is " << (result ? "true" : "false")); return result; } void DeleteCommandRequest::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()) { @@ -161,9 +163,8 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { is_ui_received_ = true; ui_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); - LOG4CXX_DEBUG(logger_, - "Received UI_DeleteCommand event with result " - << MessageHelper::HMIResultToString(ui_result_)); + SDL_LOG_DEBUG("Received UI_DeleteCommand event with result " + << MessageHelper::HMIResultToString(ui_result_)); GetInfo(message, ui_info_); break; } @@ -172,20 +173,19 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { is_vr_received_ = true; vr_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); - LOG4CXX_DEBUG(logger_, - "Received VR_DeleteCommand event with result " - << MessageHelper::HMIResultToString(vr_result_)); + SDL_LOG_DEBUG("Received VR_DeleteCommand event with result " + << MessageHelper::HMIResultToString(vr_result_)); GetInfo(message, vr_info_); break; } default: { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SDL_LOG_ERROR("Received unknown event " << event.id()); return; } } if (IsPendingResponseExist()) { - LOG4CXX_DEBUG(logger_, "Still awaiting for other responses."); + SDL_LOG_DEBUG("Still awaiting for other responses."); return; } @@ -193,7 +193,7 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); return; } smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; @@ -203,8 +203,7 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { smart_objects::SmartObject* command = application->FindCommand(cmd_id); if (!command) { - LOG4CXX_ERROR(logger_, - "Command id " << cmd_id + SDL_LOG_ERROR("Command id " << cmd_id << " not found for " "application with connection key " << connection_key()); @@ -227,7 +226,7 @@ bool DeleteCommandRequest::Init() { } bool DeleteCommandRequest::IsPendingResponseExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); return is_ui_send_ != is_ui_received_ || is_vr_send_ != is_vr_received_; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc index 919385ee50..80497241e3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DeleteCommandResponse::DeleteCommandResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ DeleteCommandResponse::DeleteCommandResponse( DeleteCommandResponse::~DeleteCommandResponse() {} void DeleteCommandResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc index 46af8353b7..127843813c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc @@ -42,6 +42,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DeleteFileRequest::DeleteFileRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,14 +59,14 @@ DeleteFileRequest::DeleteFileRequest( DeleteFileRequest::~DeleteFileRequest() {} void DeleteFileRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr application = application_manager_.application(connection_key()); if (!application) { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); return; } @@ -75,8 +77,7 @@ void DeleteFileRequest::Run() { application->delete_file_in_none_count())) { // If application is in the HMI_NONE level the quantity of allowed // DeleteFile request is limited by the configuration profile - LOG4CXX_ERROR(logger_, - "Too many requests from the app with HMILevel HMI_NONE "); + SDL_LOG_ERROR("Too many requests from the app with HMILevel HMI_NONE"); SendResponse(false, mobile_apis::Result::REJECTED); return; } @@ -86,7 +87,7 @@ void DeleteFileRequest::Run() { if (!file_system::IsFileNameValid(sync_file_name)) { const std::string err_msg = "Sync file name contains forbidden symbols."; - LOG4CXX_ERROR(logger_, err_msg); + SDL_LOG_ERROR(err_msg); SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str()); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc index 732a1e56b5..7f9181e29a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DeleteFileResponse::DeleteFileResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,12 +57,12 @@ DeleteFileResponse::DeleteFileResponse( DeleteFileResponse::~DeleteFileResponse() {} void DeleteFileResponse::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); if (!app) { - LOG4CXX_ERROR(logger_, "Application not registered"); + SDL_LOG_ERROR("Application not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc index 7950595b1c..6c52d60007 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc @@ -43,6 +43,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DeleteInteractionChoiceSetRequest::DeleteInteractionChoiceSetRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -58,14 +60,13 @@ DeleteInteractionChoiceSetRequest::DeleteInteractionChoiceSetRequest( DeleteInteractionChoiceSetRequest::~DeleteInteractionChoiceSetRequest() {} void DeleteInteractionChoiceSetRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR( - logger_, - "No application associated with connection key " << connection_key()); + SDL_LOG_ERROR("No application associated with connection key " + << connection_key()); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -75,14 +76,13 @@ void DeleteInteractionChoiceSetRequest::Run() { .asInt(); if (!app->FindChoiceSet(choice_set_id)) { - LOG4CXX_ERROR(logger_, - "Choice set with id " << choice_set_id << " is not found."); + SDL_LOG_ERROR("Choice set with id " << choice_set_id << " is not found."); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } if (ChoiceSetInUse(app)) { - LOG4CXX_ERROR(logger_, "Choice set currently in use."); + SDL_LOG_ERROR("Choice set currently in use."); SendResponse(false, mobile_apis::Result::IN_USE); return; } @@ -108,7 +108,7 @@ bool DeleteInteractionChoiceSetRequest::Init() { bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse( ApplicationConstSharedPtr app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!app->is_perform_interaction_active()) { return false; } @@ -126,8 +126,7 @@ bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse( PerformChoice::const_iterator choice_it = choice.begin(); for (; choice.end() != choice_it; ++choice_it) { if (choice_it->first == choice_set_id) { - LOG4CXX_ERROR(logger_, - "Choice set with id " << choice_set_id << " is in use."); + SDL_LOG_ERROR("Choice set with id " << choice_set_id << " is in use."); return true; } } @@ -137,7 +136,7 @@ bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse( void DeleteInteractionChoiceSetRequest::SendVrDeleteCommand( application_manager::ApplicationSharedPtr app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const uint32_t choice_set_id = (*message_)[strings::msg_params][strings::interaction_choice_set_id] @@ -146,8 +145,7 @@ void DeleteInteractionChoiceSetRequest::SendVrDeleteCommand( smart_objects::SmartObject* choice_set = app->FindChoiceSet(choice_set_id); if (!choice_set) { - LOG4CXX_ERROR(logger_, - "Choice set with id " << choice_set_id << " is not found."); + SDL_LOG_ERROR("Choice set with id " << choice_set_id << " is not found."); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc index cf5ad3a2c2..5aaa896b02 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc @@ -42,6 +42,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DeleteInteractionChoiceSetResponse::DeleteInteractionChoiceSetResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,12 +59,12 @@ DeleteInteractionChoiceSetResponse::DeleteInteractionChoiceSetResponse( DeleteInteractionChoiceSetResponse::~DeleteInteractionChoiceSetResponse() {} void DeleteInteractionChoiceSetResponse::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; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc index 383daa9b83..b4a1d7f0c1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc @@ -44,6 +44,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DeleteSubMenuRequest::DeleteSubMenuRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -59,13 +61,13 @@ DeleteSubMenuRequest::DeleteSubMenuRequest( DeleteSubMenuRequest::~DeleteSubMenuRequest() {} void DeleteSubMenuRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); return; } @@ -73,7 +75,7 @@ void DeleteSubMenuRequest::Run() { (*message_)[strings::msg_params][strings::menu_id].asInt(); if (!app->FindSubMenu(menu_id)) { - LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found."); + SDL_LOG_ERROR("Menu with id " << menu_id << " is not found."); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } @@ -92,13 +94,13 @@ void DeleteSubMenuRequest::Run() { void DeleteSubMenuRequest::DeleteNestedSubMenus(ApplicationSharedPtr const app, uint32_t parentID, const SubMenuMap& subMenus) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SubMenuMap::const_iterator it = subMenus.begin(); - LOG4CXX_DEBUG(logger_, "Delete Submenus with Parent ID: " << parentID); + SDL_LOG_DEBUG("Delete Submenus with Parent ID: " << parentID); while (subMenus.end() != it) { if (!(*it->second).keyExists(strings::parent_id)) { - LOG4CXX_ERROR(logger_, "parent ID does not exist"); + SDL_LOG_ERROR("parent ID does not exist"); ++it; continue; } @@ -114,7 +116,7 @@ void DeleteSubMenuRequest::DeleteNestedSubMenus(ApplicationSharedPtr const app, msg_params[strings::app_id] = app->app_id(); SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params); ++it; - LOG4CXX_DEBUG(logger_, "Removing submenuID: " << menuID); + SDL_LOG_DEBUG("Removing submenuID: " << menuID); app->RemoveSubMenu(menuID); } else { ++it; @@ -124,7 +126,7 @@ void DeleteSubMenuRequest::DeleteNestedSubMenus(ApplicationSharedPtr const app, void DeleteSubMenuRequest::DeleteSubMenuVRCommands( ApplicationConstSharedPtr app, uint32_t parentID) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const DataAccessor<CommandsMap> accessor = app->commands_map(); const CommandsMap& commands = accessor.GetData(); @@ -151,15 +153,16 @@ void DeleteSubMenuRequest::DeleteSubMenuVRCommands( void DeleteSubMenuRequest::DeleteSubMenuUICommands( ApplicationSharedPtr const app, uint32_t parentID) { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Delete UI Commands with Parent ID: " << parentID); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Delete UI Commands with Parent ID: " << parentID); + const DataAccessor<CommandsMap> accessor(app->commands_map()); const CommandsMap& commands = accessor.GetData(); CommandsMap::const_iterator it = commands.begin(); while (commands.end() != it) { if (!(*it->second).keyExists(strings::menu_params)) { - LOG4CXX_ERROR(logger_, "menu_params not exist"); + SDL_LOG_ERROR("menu_params not exist"); ++it; continue; } @@ -171,7 +174,7 @@ void DeleteSubMenuRequest::DeleteSubMenuUICommands( const uint32_t cmd_id = (*it->second)[strings::cmd_id].asUInt(); msg_params[strings::app_id] = app->app_id(); msg_params[strings::cmd_id] = cmd_id; - LOG4CXX_DEBUG(logger_, "Removing UI Command: " << cmd_id); + SDL_LOG_DEBUG("Removing UI Command: " << cmd_id); app->RemoveCommand(cmd_id); app->help_prompt_manager().OnVrCommandDeleted(cmd_id, false); it = commands.begin(); // Can not relay on @@ -185,7 +188,7 @@ void DeleteSubMenuRequest::DeleteSubMenuUICommands( } void DeleteSubMenuRequest::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()) { @@ -203,7 +206,7 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) { application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } @@ -227,7 +230,7 @@ void DeleteSubMenuRequest::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/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc index 3cefef5c38..25c4dc7cb9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DeleteSubMenuResponse::DeleteSubMenuResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ DeleteSubMenuResponse::DeleteSubMenuResponse( DeleteSubMenuResponse::~DeleteSubMenuResponse() {} void DeleteSubMenuResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc index 7f253e25fd..214a9c2bab 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DeleteWindowRequest::DeleteWindowRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -58,13 +60,12 @@ bool DeleteWindowRequest::CheckWindowId( const WindowID window_id = (*message_)[strings::msg_params][strings::window_id].asInt(); if (mobile_apis::PredefinedWindows::DEFAULT_WINDOW == window_id) { - LOG4CXX_ERROR(logger_, "Main application window can't be deleted"); + SDL_LOG_ERROR("Main application window can't be deleted"); return false; } if (!app->WindowIdExists(window_id)) { - LOG4CXX_ERROR(logger_, - "Window with id #" << window_id << " does not exist"); + SDL_LOG_ERROR("Window with id #" << window_id << " does not exist"); return false; } @@ -85,13 +86,13 @@ void DeleteWindowRequest::DeleteWindow( } void DeleteWindowRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr application = application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -109,10 +110,10 @@ void DeleteWindowRequest::Run() { } void DeleteWindowRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (hmi_apis::FunctionID::UI_DeleteWindow != event.id()) { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SDL_LOG_ERROR("Received unknown event " << event.id()); return; } @@ -120,12 +121,12 @@ void DeleteWindowRequest::on_event(const event_engine::Event& event) { application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } - LOG4CXX_INFO(logger_, "Received DeleteWindow event"); + SDL_LOG_INFO("Received DeleteWindow event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); const smart_objects::SmartObject& response_message = event.smart_object(); @@ -138,7 +139,7 @@ void DeleteWindowRequest::on_event(const event_engine::Event& event) { GetInfo(response_message, response_info); if (!is_success) { - LOG4CXX_ERROR(logger_, "DeleteWindow request has failed on HMI side"); + SDL_LOG_ERROR("DeleteWindow request has failed on HMI side"); SendResponse(is_success, result_code, response_info.empty() ? nullptr : response_info.c_str()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_response.cc index f9ac9a46d6..1703623a38 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_window_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DeleteWindowResponse::DeleteWindowResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ DeleteWindowResponse::DeleteWindowResponse( DeleteWindowResponse::~DeleteWindowResponse() {} void DeleteWindowResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc index 1de7a3ea03..f0ef2e0028 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DialNumberRequest::DialNumberRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ DialNumberRequest::DialNumberRequest( DialNumberRequest::~DialNumberRequest() {} bool DialNumberRequest::Init() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); default_timeout_ = 0; @@ -64,13 +66,13 @@ bool DialNumberRequest::Init() { } void DialNumberRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr application = application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -78,15 +80,14 @@ void DialNumberRequest::Run() { std::string number = (*message_)[strings::msg_params][strings::number].asString(); if (!CheckSyntax(number)) { - LOG4CXX_ERROR(logger_, "Invalid incoming data"); + SDL_LOG_ERROR("Invalid incoming data"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } StripNumberParam(number); if (number.empty()) { - LOG4CXX_ERROR(logger_, - "After strip number param is empty. Invalid incoming data"); + SDL_LOG_ERROR("After strip number param is empty. Invalid incoming data"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -102,12 +103,12 @@ void DialNumberRequest::Run() { } void DialNumberRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr application = application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } @@ -115,7 +116,7 @@ void DialNumberRequest::on_event(const event_engine::Event& event) { mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS; switch (event.id()) { case hmi_apis::FunctionID::BasicCommunication_DialNumber: { - LOG4CXX_INFO(logger_, "Received DialNumber event"); + SDL_LOG_INFO("Received DialNumber event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication); result_code = CommandRequestImpl::GetMobileResultCode( static_cast<hmi_apis::Common_Result::eType>( @@ -123,7 +124,7 @@ void DialNumberRequest::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/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc index 4385b3fe90..4bbe5e2eb7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + DialNumberResponse::DialNumberResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ DialNumberResponse::DialNumberResponse( DialNumberResponse::~DialNumberResponse() {} void DialNumberResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc index 66ff7b48d5..f5506503e9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + EndAudioPassThruRequest::EndAudioPassThruRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,14 +56,14 @@ EndAudioPassThruRequest::EndAudioPassThruRequest( EndAudioPassThruRequest::~EndAudioPassThruRequest() {} void EndAudioPassThruRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_EndAudioPassThru, NULL, true); } void EndAudioPassThruRequest::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()) { @@ -89,7 +91,7 @@ void EndAudioPassThruRequest::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/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc index 6c9bd05e09..8e5672bfd9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + EndAudioPassThruResponse::EndAudioPassThruResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ EndAudioPassThruResponse::EndAudioPassThruResponse( EndAudioPassThruResponse::~EndAudioPassThruResponse() {} void EndAudioPassThruResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc index c5e94da378..585636bfa8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc @@ -6,6 +6,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetCloudAppPropertiesRequest::GetCloudAppPropertiesRequest( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, @@ -21,11 +23,11 @@ GetCloudAppPropertiesRequest::GetCloudAppPropertiesRequest( GetCloudAppPropertiesRequest::~GetCloudAppPropertiesRequest() {} void GetCloudAppPropertiesRequest::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; } @@ -83,7 +85,7 @@ void GetCloudAppPropertiesRequest::Run() { void GetCloudAppPropertiesRequest::on_event( const app_mngr::event_engine::Event& event) { - LOG4CXX_INFO(logger_, "GetCloudAppPropertiesRequest on_event"); + SDL_LOG_INFO("GetCloudAppPropertiesRequest on_event"); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_response.cc index f50897303a..35bdaaeb44 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_response.cc @@ -7,6 +7,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetCloudAppPropertiesResponse::GetCloudAppPropertiesResponse( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, @@ -22,7 +24,7 @@ GetCloudAppPropertiesResponse::GetCloudAppPropertiesResponse( GetCloudAppPropertiesResponse::~GetCloudAppPropertiesResponse() {} void GetCloudAppPropertiesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc index 75263494c2..620d901f3c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc @@ -59,6 +59,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetFileRequest::GetFileRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -85,8 +87,7 @@ bool GetFileRequest::GetFilePath(std::string& file_path, bool& forward_to_hmi) { if ((*message_)[strings::msg_params].keyExists(strings::app_service_id)) { std::string service_id = (*message_)[strings::msg_params][strings::app_service_id].asString(); - LOG4CXX_DEBUG(logger_, - "Finding storage directory for service id: " << service_id); + SDL_LOG_DEBUG("Finding storage directory for service id: " << service_id); AppService* app_service_info = application_manager_.GetAppServiceManager().FindServiceByID(service_id); @@ -101,7 +102,7 @@ bool GetFileRequest::GetFilePath(std::string& file_path, bool& forward_to_hmi) { return false; } } else { - LOG4CXX_DEBUG(logger_, "Using current storage directory"); + SDL_LOG_DEBUG("Using current storage directory"); } ApplicationSharedPtr app = application_manager_.application(connect_key); @@ -110,15 +111,15 @@ bool GetFileRequest::GetFilePath(std::string& file_path, bool& forward_to_hmi) { } void GetFileRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_INFO(logger_, "Received GetFile request"); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_INFO("Received GetFile request"); ApplicationSharedPtr app = application_manager_.application(connection_key()); smart_objects::SmartObject response_params = smart_objects::SmartObject(smart_objects::SmartType_Map); 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; } @@ -126,8 +127,7 @@ void GetFileRequest::Run() { file_name_ = (*message_)[strings::msg_params][strings::file_name].asString(); if (!file_system::IsFileNameValid(file_name_)) { - LOG4CXX_ERROR(logger_, - "File name " << file_name_ << " contains forbidden symbols."); + SDL_LOG_ERROR("File name " << file_name_ << " contains forbidden symbols."); SendResponse(false, mobile_apis::Result::INVALID_DATA, "File name contains forbidden symbols", @@ -136,7 +136,7 @@ void GetFileRequest::Run() { } // Initialize other params with default values. If exists overwrite the values - LOG4CXX_DEBUG(logger_, "Intialize non manadatory params with default values"); + SDL_LOG_DEBUG("Intialize non manadatory params with default values"); if ((*message_)[strings::msg_params].keyExists(strings::file_type)) { file_type_ = static_cast<mobile_apis::FileType::eType>( @@ -145,13 +145,13 @@ void GetFileRequest::Run() { // Check if file exists on system (may have to use app service id to get the // correct app folder) - LOG4CXX_DEBUG(logger_, "Check if file exists on system"); + SDL_LOG_DEBUG("Check if file exists on system"); std::string file_path; bool forward_to_hmi; if (GetFilePath(file_path, forward_to_hmi)) { if (forward_to_hmi) { - LOG4CXX_DEBUG(logger_, "Forwarding GetFile request to HMI"); + SDL_LOG_DEBUG("Forwarding GetFile request to HMI"); application_manager_.IncreaseForwardedRequestTimeout(connection_key(), correlation_id()); SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_GetFilePath, @@ -160,7 +160,7 @@ void GetFileRequest::Run() { return; } } else { - LOG4CXX_ERROR(logger_, "Could not get file path"); + SDL_LOG_ERROR("Could not get file path"); SendResponse(false, mobile_apis::Result::INVALID_DATA, "Could not get file path", @@ -170,7 +170,7 @@ void GetFileRequest::Run() { const std::string full_path = file_path + "/" + file_name_; if (!file_system::FileExists(full_path)) { - LOG4CXX_ERROR(logger_, "File " << full_path << " does not exist"); + SDL_LOG_ERROR("File " << full_path << " does not exist"); SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, "File does not exist", @@ -179,7 +179,7 @@ void GetFileRequest::Run() { } // Handle offset - LOG4CXX_DEBUG(logger_, "Handle offset and length parameters"); + SDL_LOG_DEBUG("Handle offset and length parameters"); const uint64_t file_size = file_system::FileSize(full_path); if ((*message_)[strings::msg_params].keyExists(strings::offset)) { @@ -195,9 +195,8 @@ void GetFileRequest::Run() { } if (offset_ > file_size) { - LOG4CXX_ERROR( - logger_, - "Offset " << offset_ << " greater than file size " << file_size); + SDL_LOG_ERROR("Offset " << offset_ << " greater than file size " + << file_size); SendResponse(false, mobile_apis::Result::INVALID_DATA, "Offset greater than file size", @@ -205,8 +204,7 @@ void GetFileRequest::Run() { return; } if (length_ > file_size - offset_) { - LOG4CXX_ERROR(logger_, - "Length " << length_ << " greater than file size - offset" + SDL_LOG_ERROR("Length " << length_ << " greater than file size - offset" << file_size); SendResponse(false, mobile_apis::Result::INVALID_DATA, @@ -216,10 +214,10 @@ void GetFileRequest::Run() { } // Load data from file as binary data - LOG4CXX_DEBUG(logger_, "Load binary data from file"); + SDL_LOG_DEBUG("Load binary data from file"); std::vector<uint8_t> bin_data; if (!file_system::ReadBinaryFile(full_path, bin_data, offset_, length_)) { - LOG4CXX_ERROR(logger_, "Failed to read from file: " << full_path); + SDL_LOG_ERROR("Failed to read from file: " << full_path); SendResponse(false, mobile_apis::Result::GENERIC_ERROR, "Unable to read from file", @@ -248,7 +246,7 @@ void GetFileRequest::Run() { } void GetFileRequest::on_event(const app_mngr::event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (hmi_apis::FunctionID::BasicCommunication_GetFilePath != event.id()) { return; @@ -287,7 +285,7 @@ void GetFileRequest::on_event(const app_mngr::event_engine::Event& event) { event_message[strings::msg_params][strings::file_path].asString(); if (!file_system::FileExists(full_path)) { - LOG4CXX_ERROR(logger_, "File " << full_path << " does not exist"); + SDL_LOG_ERROR("File " << full_path << " does not exist"); SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, "File does not exist", @@ -309,9 +307,8 @@ void GetFileRequest::on_event(const app_mngr::event_engine::Event& event) { } if (offset_ > file_size) { - LOG4CXX_ERROR( - logger_, - "Offset " << offset_ << " greater than file size " << file_size); + SDL_LOG_ERROR("Offset " << offset_ << " greater than file size " + << file_size); SendResponse(false, mobile_apis::Result::INVALID_DATA, "Offset greater than file size", @@ -319,8 +316,7 @@ void GetFileRequest::on_event(const app_mngr::event_engine::Event& event) { return; } if (length_ > file_size - offset_) { - LOG4CXX_ERROR(logger_, - "Length " << length_ << " greater than file size - offset" + SDL_LOG_ERROR("Length " << length_ << " greater than file size - offset" << file_size); SendResponse(false, mobile_apis::Result::INVALID_DATA, @@ -329,7 +325,7 @@ void GetFileRequest::on_event(const app_mngr::event_engine::Event& event) { return; } if (!file_system::ReadBinaryFile(full_path, bin_data, offset_, length_)) { - LOG4CXX_ERROR(logger_, "Failed to read from file: " << full_path); + SDL_LOG_ERROR("Failed to read from file: " << full_path); SendResponse(false, mobile_apis::Result::GENERIC_ERROR, "Failed to read from file", @@ -341,7 +337,7 @@ void GetFileRequest::on_event(const app_mngr::event_engine::Event& event) { response_params[strings::crc32_check_sum] = crc_calculated; } else { - LOG4CXX_ERROR(logger_, "HMI did not return a file path: "); + SDL_LOG_ERROR("HMI did not return a file path: "); SendResponse(false, mobile_apis::Result::INVALID_DATA, "HMI did not return a file path", diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_response.cc index 2ea8dde02a..55f6e0b8a0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_response.cc @@ -39,6 +39,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetFileResponse::GetFileResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,8 +56,8 @@ GetFileResponse::GetFileResponse( GetFileResponse::~GetFileResponse() {} void GetFileResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_INFO(logger_, "Sending GetFile response"); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_INFO("Sending GetFile response"); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc index 8b557efc5d..1cd4806f7e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc @@ -42,6 +42,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetSystemCapabilityRequest::GetSystemCapabilityRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,18 +59,18 @@ GetSystemCapabilityRequest::GetSystemCapabilityRequest( GetSystemCapabilityRequest::~GetSystemCapabilityRequest() {} void GetSystemCapabilityRequest::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 ((*message_)[strings::msg_params].empty()) { - LOG4CXX_ERROR(logger_, strings::msg_params << " is empty."); + SDL_LOG_ERROR(strings::msg_params << " is empty."); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -181,7 +183,7 @@ void GetSystemCapabilityRequest::Run() { if (!capabilities) { SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE); - LOG4CXX_INFO(logger_, "system_display_capabilities are not available"); + SDL_LOG_INFO("system_display_capabilities are not available"); return; } @@ -202,12 +204,10 @@ void GetSystemCapabilityRequest::Run() { auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app); if ((*message_)[app_mngr::strings::msg_params][strings::subscribe] .asBool() == true) { - LOG4CXX_DEBUG(logger_, - "Subscribe to system capability: " << response_type); + SDL_LOG_DEBUG("Subscribe to system capability: " << response_type); ext.SubscribeTo(response_type); } else { - LOG4CXX_DEBUG(logger_, - "Unsubscribe from system capability: " << response_type); + SDL_LOG_DEBUG("Unsubscribe from system capability: " << response_type); ext.UnsubscribeFrom(response_type); } } @@ -224,7 +224,7 @@ void GetSystemCapabilityRequest::Run() { } void GetSystemCapabilityRequest::on_event(const event_engine::Event& event) { - LOG4CXX_INFO(logger_, "GetSystemCapabilityRequest on_event"); + SDL_LOG_INFO("GetSystemCapabilityRequest on_event"); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc index 5df0c72607..e20ea00a7b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetSystemCapabilityResponse::GetSystemCapabilityResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ GetSystemCapabilityResponse::GetSystemCapabilityResponse( GetSystemCapabilityResponse::~GetSystemCapabilityResponse() {} void GetSystemCapabilityResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc index cd7d7a37b7..33d3479941 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetWayPointsRequest::GetWayPointsRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,14 +58,13 @@ GetWayPointsRequest::GetWayPointsRequest( GetWayPointsRequest::~GetWayPointsRequest() {} void GetWayPointsRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, - "An application with connection key " - << connection_key() << " is not registered."); + SDL_LOG_ERROR("An application with connection key " + << connection_key() << " is not registered."); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -79,17 +80,17 @@ void GetWayPointsRequest::Run() { } void GetWayPointsRequest::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_INFO(logger_, "Received UI_OnResetTimeout event"); + SDL_LOG_INFO("Received UI_OnResetTimeout event"); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); break; } case hmi_apis::FunctionID::Navigation_GetWayPoints: { - LOG4CXX_INFO(logger_, "Received Navigation_GetWayPoints event"); + SDL_LOG_INFO("Received Navigation_GetWayPoints event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( @@ -105,7 +106,7 @@ void GetWayPointsRequest::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; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc index e481c926b8..cbb9607d0d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + GetWayPointsResponse::GetWayPointsResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ GetWayPointsResponse::GetWayPointsResponse( GetWayPointsResponse::~GetWayPointsResponse() {} void GetWayPointsResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc index b8714b4784..9262466e34 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc @@ -44,6 +44,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ListFilesRequest::ListFilesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -59,14 +61,14 @@ ListFilesRequest::ListFilesRequest( ListFilesRequest::~ListFilesRequest() {} void ListFilesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr application = application_manager_.application(connection_key()); if (!application) { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); return; } @@ -77,8 +79,7 @@ void ListFilesRequest::Run() { application->list_files_in_none_count())) { // If application is in the HMI_NONE level the quantity of allowed // DeleteFile request is limited by the configuration profile - LOG4CXX_ERROR(logger_, - "Too many requests from the app with HMILevel HMI_NONE "); + SDL_LOG_ERROR("Too many requests from the app with HMILevel HMI_NONE "); SendResponse(false, mobile_apis::Result::REJECTED); return; } @@ -97,11 +98,10 @@ void ListFilesRequest::Run() { std::vector<std::string>::const_iterator it = persistent_files.begin(); for (; it != persistent_files.end(); ++it) { if (i < application_manager_.get_settings().list_files_response_size()) { - LOG4CXX_DEBUG(logger_, "File " + *it + " added to ListFiles response"); + SDL_LOG_DEBUG("File " + *it + " added to ListFiles response"); (*message_)[strings::msg_params][strings::filenames][i++] = *it; } else { - LOG4CXX_DEBUG(logger_, - "File " + *it + " not added to ListFiles response"); + SDL_LOG_DEBUG("File " + *it + " not added to ListFiles response"); } } (*message_)[strings::params][strings::message_type] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc index ffa8a443d5..e71c2de316 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ListFilesResponse::ListFilesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ ListFilesResponse::ListFilesResponse( ListFilesResponse::~ListFilesResponse() {} void ListFilesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc index 30d9853d97..96045552a0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc @@ -39,6 +39,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAppInterfaceUnregisteredNotification::OnAppInterfaceUnregisteredNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ OnAppInterfaceUnregisteredNotification:: ~OnAppInterfaceUnregisteredNotification() {} void OnAppInterfaceUnregisteredNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const bool final_message = IsFinalMessage(); SendNotification(final_message); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc index 3088c7df33..21a20c38c1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc @@ -37,6 +37,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnAudioPassThruNotification::OnAudioPassThruNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -52,7 +54,7 @@ OnAudioPassThruNotification::OnAudioPassThruNotification( OnAudioPassThruNotification::~OnAudioPassThruNotification() {} void OnAudioPassThruNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc index 9c4be847a1..14787d0a08 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc @@ -43,6 +43,8 @@ namespace commands { namespace mobile { +SDL_CREATE_LOG_VARIABLE("Commands") + OnButtonEventNotification::OnButtonEventNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -58,7 +60,7 @@ OnButtonEventNotification::OnButtonEventNotification( OnButtonEventNotification::~OnButtonEventNotification() {} void OnButtonEventNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const uint32_t btn_id = static_cast<uint32_t>( (*message_)[strings::msg_params][hmi_response::button_name].asInt()); @@ -71,7 +73,7 @@ void OnButtonEventNotification::Run() { if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) { // app_id is mandatory for CUSTOM_BUTTON notification if (!is_app_id_exists) { - LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonEvent without app_id."); + SDL_LOG_ERROR("CUSTOM_BUTTON OnButtonEvent without app_id."); return; } @@ -81,13 +83,12 @@ void OnButtonEventNotification::Run() { // custom_button_id is mandatory for CUSTOM_BUTTON notification if (false == (*message_)[strings::msg_params].keyExists( hmi_response::custom_button_id)) { - LOG4CXX_ERROR(logger_, - "CUSTOM_BUTTON OnButtonEvent without custom_button_id."); + SDL_LOG_ERROR("CUSTOM_BUTTON OnButtonEvent without custom_button_id."); return; } if (!app) { - LOG4CXX_ERROR(logger_, "Application doesn't exist."); + SDL_LOG_ERROR("Application doesn't exist."); return; } @@ -97,8 +98,7 @@ void OnButtonEventNotification::Run() { .asUInt(); if (false == app->IsSubscribedToSoftButton(custom_btn_id)) { - LOG4CXX_ERROR(logger_, - "Application doesn't subscribed to this custom_button_id."); + SDL_LOG_ERROR("Application doesn't subscribed to this custom_button_id."); return; } @@ -106,9 +106,9 @@ void OnButtonEventNotification::Run() { (*message_)[strings::msg_params][strings::window_id] = window_id; const auto window_hmi_level = app->hmi_level(window_id); if ((mobile_api::HMILevel::HMI_NONE == window_hmi_level)) { - LOG4CXX_WARN(logger_, - "CUSTOM_BUTTON OnButtonEvent notification is not allowed in " - "NONE hmi level"); + SDL_LOG_WARN( + "CUSTOM_BUTTON OnButtonEvent notification is not allowed in " + "NONE hmi level"); return; } @@ -124,7 +124,7 @@ void OnButtonEventNotification::Run() { for (; subscribed_apps.end() != it; ++it) { ApplicationSharedPtr subscribed_app = *it; if (!subscribed_app) { - LOG4CXX_WARN(logger_, "Null pointer to subscribed app."); + SDL_LOG_WARN("Null pointer to subscribed app."); continue; } @@ -134,9 +134,8 @@ void OnButtonEventNotification::Run() { mobile_apis::PredefinedWindows::DEFAULT_WINDOW); if ((mobile_api::HMILevel::HMI_FULL != app_hmi_level) && (mobile_api::HMILevel::HMI_LIMITED != app_hmi_level)) { - LOG4CXX_WARN(logger_, - "OnButtonEvent notification is allowed only" - << "in FULL or LIMITED hmi level"); + SDL_LOG_WARN("OnButtonEvent notification is allowed only" + << "in FULL or LIMITED hmi level"); continue; } // if OK button and "app_id" absent send notification only in HMI_FULL mode @@ -150,7 +149,7 @@ void OnButtonEventNotification::Run() { void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) { if (!app) { - LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer"); + SDL_LOG_ERROR("OnButtonEvent NULL pointer"); return; } @@ -158,7 +157,7 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) { std::make_shared<smart_objects::SmartObject>(); if (!on_btn_event) { - LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer"); + SDL_LOG_ERROR("OnButtonEvent NULL pointer"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc index 87d16e87e6..4444f0d156 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc @@ -44,6 +44,8 @@ namespace commands { namespace mobile { +SDL_CREATE_LOG_VARIABLE("Commands") + OnButtonPressNotification::OnButtonPressNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -59,7 +61,7 @@ OnButtonPressNotification::OnButtonPressNotification( OnButtonPressNotification::~OnButtonPressNotification() {} void OnButtonPressNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const uint32_t btn_id = static_cast<uint32_t>( (*message_)[strings::msg_params][hmi_response::button_name].asInt()); @@ -76,20 +78,19 @@ void OnButtonPressNotification::Run() { if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) { // app_id is mandatory for CUSTOM_BUTTON notification if (!is_app_id_exists) { - LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonPress without app_id."); + SDL_LOG_ERROR("CUSTOM_BUTTON OnButtonPress without app_id."); return; } // custom_button_id is mandatory for CUSTOM_BUTTON notification if (false == (*message_)[strings::msg_params].keyExists( hmi_response::custom_button_id)) { - LOG4CXX_ERROR(logger_, - "CUSTOM_BUTTON OnButtonPress without custom_button_id."); + SDL_LOG_ERROR("CUSTOM_BUTTON OnButtonPress without custom_button_id."); return; } if (!app) { - LOG4CXX_ERROR(logger_, "Application doesn't exist."); + SDL_LOG_ERROR("Application doesn't exist."); return; } @@ -99,8 +100,7 @@ void OnButtonPressNotification::Run() { .asUInt(); if (false == app->IsSubscribedToSoftButton(custom_btn_id)) { - LOG4CXX_ERROR(logger_, - "Application doesn't subscribed to this custom_button_id."); + SDL_LOG_ERROR("Application doesn't subscribed to this custom_button_id."); return; } @@ -110,9 +110,9 @@ void OnButtonPressNotification::Run() { (*message_)[strings::msg_params][strings::window_id] = window_id; const auto window_hmi_level = app->hmi_level(window_id); if ((mobile_api::HMILevel::HMI_NONE == window_hmi_level)) { - LOG4CXX_WARN(logger_, - "CUSTOM_BUTTON OnButtonPress notification is not allowed in " - "NONE hmi level"); + SDL_LOG_WARN( + "CUSTOM_BUTTON OnButtonPress notification is not allowed in " + "NONE hmi level"); return; } @@ -128,7 +128,7 @@ void OnButtonPressNotification::Run() { for (; subscribed_apps.end() != it; ++it) { ApplicationSharedPtr subscribed_app = *it; if (!subscribed_app) { - LOG4CXX_WARN(logger_, "Null pointer to subscribed app."); + SDL_LOG_WARN("Null pointer to subscribed app."); continue; } @@ -138,9 +138,8 @@ void OnButtonPressNotification::Run() { mobile_apis::PredefinedWindows::DEFAULT_WINDOW); if ((mobile_api::HMILevel::HMI_FULL != app_hmi_level) && (mobile_api::HMILevel::HMI_LIMITED != app_hmi_level)) { - LOG4CXX_WARN(logger_, - "OnButtonPress notification is allowed only" - << "in FULL or LIMITED hmi level"); + SDL_LOG_WARN("OnButtonPress notification is allowed only " + << "in FULL or LIMITED hmi level"); continue; } // if "appID" is present, send it to named app only if its FULL or @@ -160,7 +159,7 @@ void OnButtonPressNotification::Run() { void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) { if (!app) { - LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer"); + SDL_LOG_ERROR("OnButtonPress NULL pointer"); return; } @@ -168,7 +167,7 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) { std::make_shared<smart_objects::SmartObject>(); if (!on_btn_press) { - LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer"); + SDL_LOG_ERROR("OnButtonPress NULL pointer"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc index 9c7edf74e6..afd73e7e4a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnCommandNotification::OnCommandNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,13 +57,13 @@ OnCommandNotification::OnCommandNotification( OnCommandNotification::~OnCommandNotification() {} void OnCommandNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application( (*message_)[strings::msg_params][strings::app_id].asInt()); if (!app) { - LOG4CXX_ERROR(logger_, "No application associated with session key"); + SDL_LOG_ERROR("No application associated with session key"); return; } @@ -69,7 +71,7 @@ void OnCommandNotification::Run() { (*message_)[strings::msg_params][strings::cmd_id].asUInt(); if (!app->FindCommand(cmd_id)) { - LOG4CXX_ERROR(logger_, " No applications found for the command " << cmd_id); + SDL_LOG_ERROR("No applications found for the command " << cmd_id); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc index 42a1928f2e..960f9d9630 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc @@ -43,6 +43,8 @@ namespace commands { namespace mobile { +SDL_CREATE_LOG_VARIABLE("Commands") + OnDriverDistractionNotification::OnDriverDistractionNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -58,7 +60,7 @@ OnDriverDistractionNotification::OnDriverDistractionNotification( OnDriverDistractionNotification::~OnDriverDistractionNotification() {} void OnDriverDistractionNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc index c2ce2550b9..873e9f1788 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc @@ -45,6 +45,8 @@ namespace commands { namespace mobile { +SDL_CREATE_LOG_VARIABLE("Commands") + OnHashChangeNotification::OnHashChangeNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -60,7 +62,7 @@ OnHashChangeNotification::OnHashChangeNotification( OnHashChangeNotification::~OnHashChangeNotification() {} void OnHashChangeNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::message_type] = static_cast<int32_t>(application_manager::MessageType::kNotification); @@ -72,8 +74,7 @@ void OnHashChangeNotification::Run() { (*message_)[strings::msg_params][strings::hash_id] = app->curHash(); SendNotification(); } else { - LOG4CXX_WARN(logger_, - "Application with app_id " << app_id << " does not exist"); + SDL_LOG_WARN("Application with app_id " << app_id << " does not exist"); } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc index df3bce0154..66a0fbb3f6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc @@ -41,6 +41,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnHMIStatusNotification::OnHMIStatusNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,20 +58,20 @@ OnHMIStatusNotification::OnHMIStatusNotification( OnHMIStatusNotification::~OnHMIStatusNotification() {} void OnHMIStatusNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::message_type] = static_cast<int32_t>(application_manager::MessageType::kNotification); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (app.use_count() == 0) { - LOG4CXX_ERROR(logger_, "OnHMIStatusNotification application doesn't exist"); + SDL_LOG_ERROR("OnHMIStatusNotification application doesn't exist"); return; } // If the response has no hmi level, return and don't send the notification if (!(*message_)[strings::msg_params].keyExists(strings::hmi_level)) { // our notification clearly isn't well-formed - LOG4CXX_ERROR(logger_, "OnHMIStatusNotification has no hmiLevel field"); + SDL_LOG_ERROR("OnHMIStatusNotification has no hmiLevel field"); return; } @@ -82,8 +84,7 @@ void OnHMIStatusNotification::Run() { (mobile_apis::HMILevel::HMI_LIMITED == hmi_level)) { if (!(app->tts_properties_in_full())) { app->set_tts_properties_in_full(true); - LOG4CXX_INFO(logger_, - "OnHMIStatusNotification AddAppToTTSGlobalPropertiesList"); + SDL_LOG_INFO("OnHMIStatusNotification AddAppToTTSGlobalPropertiesList"); application_manager_.AddAppToTTSGlobalPropertiesList(app->app_id()); } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc index 28325a40f5..2263e4b989 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc @@ -39,6 +39,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnHMIStatusNotificationFromMobile::OnHMIStatusNotificationFromMobile( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,15 +56,15 @@ OnHMIStatusNotificationFromMobile::OnHMIStatusNotificationFromMobile( OnHMIStatusNotificationFromMobile::~OnHMIStatusNotificationFromMobile() {} void OnHMIStatusNotificationFromMobile::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::message_type] = static_cast<int32_t>(application_manager::MessageType::kNotification); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (app.use_count() == 0) { - LOG4CXX_ERROR( - logger_, "OnHMIStatusNotificationFromMobile application doesn't exist"); + SDL_LOG_ERROR( + "OnHMIStatusNotificationFromMobile application doesn't exist"); return; } @@ -79,9 +81,8 @@ void OnHMIStatusNotificationFromMobile::Run() { bool is_apps_requested_before = application_manager_.IsAppsQueriedFrom(handle); - LOG4CXX_DEBUG(logger_, - "Mobile HMI state notication came for connection key:" - << connection_key() << " and handle: " << handle); + SDL_LOG_DEBUG("Mobile HMI state notification came for connection key: " + << connection_key() << " and handle: " << handle); if (!is_apps_requested_before && Message::is_sufficient_version( @@ -96,10 +97,10 @@ void OnHMIStatusNotificationFromMobile::Run() { } if (is_apps_requested_before) { - LOG4CXX_DEBUG(logger_, - "Remote apps list had been requested already " - " for handle: " - << handle); + SDL_LOG_DEBUG( + "Remote apps list had been requested already " + "for handle: " + << handle); if (Message::is_sufficient_version( protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4, diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc index 1c0609e17d..38f346ac5c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc @@ -43,6 +43,8 @@ namespace commands { namespace mobile { +SDL_CREATE_LOG_VARIABLE("Commands") + OnKeyBoardInputNotification::OnKeyBoardInputNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -58,7 +60,7 @@ OnKeyBoardInputNotification::OnKeyBoardInputNotification( OnKeyBoardInputNotification::~OnKeyBoardInputNotification() {} void OnKeyBoardInputNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app_to_notify; @@ -70,15 +72,14 @@ void OnKeyBoardInputNotification::Run() { if (app->is_perform_interaction_active() && (*it)->perform_interaction_layout() == mobile_apis::LayoutMode::KEYBOARD) { - LOG4CXX_INFO(logger_, - "There is application with active PerformInteraction"); + SDL_LOG_INFO("There is application with active PerformInteraction"); app_to_notify = app; break; } if (mobile_apis::HMILevel::eType::HMI_FULL == app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW)) { - LOG4CXX_INFO(logger_, "There is application in HMI_FULL level"); + SDL_LOG_INFO("There is application in HMI_FULL level"); app_to_notify = app; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc index 9605fd6074..363ea9bbc3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnLanguageChangeNotification::OnLanguageChangeNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnLanguageChangeNotification::OnLanguageChangeNotification( OnLanguageChangeNotification::~OnLanguageChangeNotification() {} void OnLanguageChangeNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc index f64ca34bf2..7c0c27040d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnPermissionsChangeNotification::OnPermissionsChangeNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ OnPermissionsChangeNotification::OnPermissionsChangeNotification( OnPermissionsChangeNotification::~OnPermissionsChangeNotification() {} void OnPermissionsChangeNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_subtle_alert_pressed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_subtle_alert_pressed_notification.cc index ce1d1b16d1..6cbd391070 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_subtle_alert_pressed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_subtle_alert_pressed_notification.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnSubtleAlertPressedNotification::OnSubtleAlertPressedNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,13 +55,13 @@ OnSubtleAlertPressedNotification::OnSubtleAlertPressedNotification( OnSubtleAlertPressedNotification::~OnSubtleAlertPressedNotification() {} void OnSubtleAlertPressedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application( (*message_)[strings::msg_params][strings::app_id].asInt()); if (!app) { - LOG4CXX_ERROR(logger_, "No application associated with session key"); + SDL_LOG_ERROR("No application associated with session key"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc index cc6ab7b65b..6c16e1156e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc @@ -13,6 +13,8 @@ using namespace application_manager; namespace commands { namespace mobile { +SDL_CREATE_LOG_VARIABLE("Commands") + OnSystemCapabilityUpdatedNotification::OnSystemCapabilityUpdatedNotification( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, @@ -29,7 +31,7 @@ OnSystemCapabilityUpdatedNotification:: ~OnSystemCapabilityUpdatedNotification() {} void OnSystemCapabilityUpdatedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; const auto system_capability_type = @@ -117,9 +119,8 @@ void OnSystemCapabilityUpdatedNotification::Run() { app_services->end(), matching_service_predicate); if (it != app_services->end()) { - LOG4CXX_DEBUG( - logger_, - "Replacing updated record with service_id " << service_id); + SDL_LOG_DEBUG("Replacing updated record with service_id " + << service_id); app_services->erase(it); } app_services->push_back(updated_capabilities[i]); @@ -136,11 +137,10 @@ void OnSystemCapabilityUpdatedNotification::Run() { } default: { - LOG4CXX_ERROR(logger_, - "Unknown system capability type: " - << msg_params[strings::system_capability] - [strings::system_capability_type] - .asInt()); + SDL_LOG_ERROR("Unknown system capability type: " + << msg_params[strings::system_capability] + [strings::system_capability_type] + .asInt()); return; } } @@ -159,8 +159,7 @@ void OnSystemCapabilityUpdatedNotification::Run() { DCHECK_OR_RETURN(app, false); auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app); if (!ext.IsSubscribedTo(system_capability_type)) { - LOG4CXX_DEBUG(logger_, - "App " << app->app_id() + SDL_LOG_DEBUG("App " << app->app_id() << " is not subscribed to this capability type"); return false; } @@ -168,14 +167,12 @@ void OnSystemCapabilityUpdatedNotification::Run() { if (mobile_apis::SystemCapabilityType::DISPLAYS == system_capability_type && initial_connection_key > 0) { - LOG4CXX_DEBUG(logger_, - "Display capabilities notification for app " - << initial_connection_key << " only"); + SDL_LOG_DEBUG("Display capabilities notification for app " + << initial_connection_key << " only"); return app->app_id() == initial_connection_key; } - LOG4CXX_DEBUG(logger_, - "App " << app->app_id() + SDL_LOG_DEBUG("App " << app->app_id() << " is subscribed to specified capability type"); return true; }; @@ -183,8 +180,7 @@ void OnSystemCapabilityUpdatedNotification::Run() { const std::vector<ApplicationSharedPtr>& applications = FindAllApps( application_manager_.applications(), subscribed_to_capability_predicate); - LOG4CXX_DEBUG(logger_, - "Number of Notifications to be sent: " << applications.size()); + SDL_LOG_DEBUG("Number of Notifications to be sent: " << applications.size()); std::vector<ApplicationSharedPtr>::const_iterator app_it = applications.begin(); @@ -194,31 +190,28 @@ void OnSystemCapabilityUpdatedNotification::Run() { if (system_capability_type == mobile_apis::SystemCapabilityType::REMOTE_CONTROL && !app->is_remote_control_supported()) { - LOG4CXX_WARN( - logger_, + SDL_LOG_WARN( "App with connection key: " - << app->app_id() - << " was subcribed to REMOTE_CONTROL system capabilities, but " - "does not have RC permissions. Unsubscribing"); + << app->app_id() + << " was subcribed to REMOTE_CONTROL system capabilities, but " + "does not have RC permissions. Unsubscribing"); auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app); ext.UnsubscribeFrom(system_capability_type); continue; } if (mobile_apis::SystemCapabilityType::DISPLAYS == system_capability_type) { - LOG4CXX_DEBUG(logger_, "Using common display capabilities"); + SDL_LOG_DEBUG("Using common display capabilities"); auto capabilities = hmi_capabilities_.system_display_capabilities(); if (app->is_resuming() && app->is_app_data_resumption_allowed()) { - LOG4CXX_DEBUG(logger_, - "Application " - << app->app_id() - << " is resuming. Providing cached capabilities"); + SDL_LOG_DEBUG("Application " + << app->app_id() + << " is resuming. Providing cached capabilities"); auto display_caps = app->display_capabilities_builder().display_capabilities(); capabilities = display_caps; } else if (app->display_capabilities()) { - LOG4CXX_DEBUG(logger_, - "Application " << app->app_id() + SDL_LOG_DEBUG("Application " << app->app_id() << " has specific display capabilities"); const WindowID window_id = msg_params[strings::system_capability] @@ -229,8 +222,7 @@ void OnSystemCapabilityUpdatedNotification::Run() { } if (!capabilities) { - LOG4CXX_WARN(logger_, - "No available display capabilities for sending. Skipping"); + SDL_LOG_WARN("No available display capabilities for sending. Skipping"); continue; } @@ -238,8 +230,7 @@ void OnSystemCapabilityUpdatedNotification::Run() { *capabilities; } - LOG4CXX_INFO(logger_, - "Sending OnSystemCapabilityUpdated " << capability_type_string + SDL_LOG_INFO("Sending OnSystemCapabilityUpdated " << capability_type_string << " application id " << app->app_id()); (*message_)[strings::params][strings::connection_key] = app->app_id(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc index 9c868172f5..90ed038b89 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc @@ -48,6 +48,8 @@ namespace commands { namespace mobile { +SDL_CREATE_LOG_VARIABLE("Commands") + OnSystemRequestNotification::OnSystemRequestNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -63,7 +65,7 @@ OnSystemRequestNotification::OnSystemRequestNotification( OnSystemRequestNotification::~OnSystemRequestNotification() {} void OnSystemRequestNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace application_manager; using namespace mobile_apis; using namespace helpers; @@ -71,8 +73,7 @@ void OnSystemRequestNotification::Run() { ApplicationSharedPtr app = application_manager_.application(connection_key()); if (app.use_count() == 0) { - LOG4CXX_ERROR(logger_, - "Application with connection key " << connection_key() + SDL_LOG_ERROR("Application with connection key " << connection_key() << " is not registered."); return; } @@ -88,8 +89,7 @@ void OnSystemRequestNotification::Run() { if (!policy_handler.IsRequestTypeAllowed( app->device(), app->policy_app_id(), request_type)) { - LOG4CXX_WARN(logger_, - "Request type " << stringified_request_type + SDL_LOG_WARN("Request type " << stringified_request_type << " is not allowed by policies"); return; } @@ -101,15 +101,13 @@ void OnSystemRequestNotification::Run() { (*message_)[strings::msg_params][strings::request_subtype].asString(); if (!policy_handler.IsRequestSubTypeAllowed(app->policy_app_id(), request_subtype)) { - LOG4CXX_ERROR(logger_, - "Request subtype: " << request_subtype + SDL_LOG_ERROR("Request subtype: " << request_subtype << " is DISALLOWED by policies"); return; } } - LOG4CXX_DEBUG(logger_, - "Processing Request type : " << stringified_request_type); + SDL_LOG_DEBUG("Processing Request type : " << stringified_request_type); const bool binary_data_is_required = Compare<mobile_apis::RequestType::eType, EQ, ONE>( @@ -154,8 +152,7 @@ void OnSystemRequestNotification::Run() { } else if (mobile_apis::RequestType::LOCK_SCREEN_ICON_URL == request_type) { if (!(*message_)[strings::msg_params].keyExists(strings::url) || (*message_)[strings::msg_params][strings::url].empty()) { - LOG4CXX_ERROR(logger_, - "discarding LOCK_SCREEN_ICON_URL request without URL"); + SDL_LOG_ERROR("discarding LOCK_SCREEN_ICON_URL request without URL"); return; } } @@ -165,7 +162,7 @@ void OnSystemRequestNotification::Run() { #ifdef PROPRIETARY_MODE void OnSystemRequestNotification::AddHeader(BinaryMessage& message) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const uint32_t timeout = policy_handler_.TimeoutExchangeSec(); size_t content_length; @@ -223,8 +220,8 @@ void OnSystemRequestNotification::AddHeader(BinaryMessage& message) const { message.clear(); message.assign(header.begin(), header.end()); - LOG4CXX_DEBUG( - logger_, "Header added: " << std::string(message.begin(), message.end())); + SDL_LOG_DEBUG( + "Header added: " << std::string(message.begin(), message.end())); } size_t OnSystemRequestNotification::ParsePTString( diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc index 0a8420b6a3..944fb0c148 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnTBTClientStateNotification::OnTBTClientStateNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ OnTBTClientStateNotification::OnTBTClientStateNotification( OnTBTClientStateNotification::~OnTBTClientStateNotification() {} void OnTBTClientStateNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); (*message_)[strings::params][strings::message_type] = static_cast<int32_t>(application_manager::MessageType::kNotification); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc index 6ceb381d2e..02ec1be53f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc @@ -42,6 +42,8 @@ namespace commands { namespace mobile { +SDL_CREATE_LOG_VARIABLE("Commands") + OnTouchEventNotification::OnTouchEventNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,7 +59,7 @@ OnTouchEventNotification::OnTouchEventNotification( OnTouchEventNotification::~OnTouchEventNotification() {} void OnTouchEventNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const std::vector<ApplicationSharedPtr>& applications_with_navi = application_manager_.applications_with_navi(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_update_file_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_update_file_notification.cc index 171772a549..d3257844ec 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_update_file_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_update_file_notification.cc @@ -39,6 +39,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnUpdateFileNotification::OnUpdateFileNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ OnUpdateFileNotification::OnUpdateFileNotification( OnUpdateFileNotification::~OnUpdateFileNotification() {} void OnUpdateFileNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_update_sub_menu_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_update_sub_menu_notification.cc index 0e598cf475..05ff9fc8e5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_update_sub_menu_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_update_sub_menu_notification.cc @@ -39,6 +39,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnUpdateSubMenuNotification::OnUpdateSubMenuNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ OnUpdateSubMenuNotification::OnUpdateSubMenuNotification( OnUpdateSubMenuNotification::~OnUpdateSubMenuNotification() {} void OnUpdateSubMenuNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendNotification(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc index 39e0735013..33413f805d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc @@ -38,6 +38,8 @@ namespace sdl_rpc_plugin { using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + OnWayPointChangeNotification::OnWayPointChangeNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ OnWayPointChangeNotification::OnWayPointChangeNotification( OnWayPointChangeNotification::~OnWayPointChangeNotification() {} void OnWayPointChangeNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::set<uint32_t> subscribed_for_way_points = application_manager_.GetAppsSubscribedForWayPoints(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc index 2f3d38f0b0..5918c05f2d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc @@ -43,6 +43,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + namespace str = strings; PerformAudioPassThruRequest::PerformAudioPassThruRequest( @@ -64,7 +66,7 @@ PerformAudioPassThruRequest::PerformAudioPassThruRequest( PerformAudioPassThruRequest::~PerformAudioPassThruRequest() {} void PerformAudioPassThruRequest::onTimeOut() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); FinishTTSSpeak(); CommandRequestImpl::onTimeOut(); @@ -77,28 +79,28 @@ bool PerformAudioPassThruRequest::Init() { } void PerformAudioPassThruRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED"); + SDL_LOG_ERROR("APPLICATION_NOT_REGISTERED"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } if (mobile_api::HMILevel::HMI_NONE == app->hmi_level(mobile_apis::PredefinedWindows::DEFAULT_WINDOW)) { - LOG4CXX_ERROR(logger_, "application isn't activated"); + SDL_LOG_ERROR("application isn't activated"); SendResponse(false, mobile_apis::Result::REJECTED); return; } if (IsWhiteSpaceExist()) { - LOG4CXX_ERROR(logger_, - "Incoming perform audio pass thru has contains " - "\\t\\n \\\\t \\\\n" - " text contains only whitespace in initialPrompt"); + SDL_LOG_ERROR( + "Incoming perform audio pass thru has contains " + "\\t\\n \\\\t \\\\n" + " text contains only whitespace in initialPrompt"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -114,9 +116,8 @@ void PerformAudioPassThruRequest::Run() { initial_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR( - logger_, - "MessageHelper::VerifyTtsFiles return " << verification_result); + SDL_LOG_ERROR("MessageHelper::VerifyTtsFiles return " + << verification_result); SendResponse( false, mobile_apis::Result::FILE_NOT_FOUND, @@ -135,14 +136,14 @@ void PerformAudioPassThruRequest::Run() { } void PerformAudioPassThruRequest::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(); switch (event.id()) { case hmi_apis::FunctionID::UI_PerformAudioPassThru: { - LOG4CXX_TRACE(logger_, "Received UI_PerformAudioPassThru"); + SDL_LOG_TRACE("Received UI_PerformAudioPassThru"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); result_ui_ = static_cast<hmi_apis::Common_Result::eType>( @@ -151,7 +152,7 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) { // in case perform audio is started by other request skip stopping if (hmi_apis::Common_Result::REJECTED == result_ui_) { - LOG4CXX_ERROR(logger_, "Request was rejected"); + SDL_LOG_ERROR("Request was rejected"); SendResponse(false, MessageHelper::HMIToMobileResult(result_ui_), NULL, @@ -162,7 +163,7 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::TTS_Speak: { - LOG4CXX_INFO(logger_, "Received TTS_Speak event"); + SDL_LOG_INFO("Received TTS_Speak event"); result_tts_speak_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asUInt()); GetInfo(message, tts_info_); @@ -188,14 +189,14 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::TTS_OnResetTimeout: { - LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event"); + SDL_LOG_INFO("Received TTS_OnResetTimeout event"); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); break; } default: { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SDL_LOG_ERROR("Received unknown event " << event.id()); return; } } @@ -214,7 +215,7 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) { const PerformAudioPassThruRequest::ResponseParams& PerformAudioPassThruRequest::PrepareResponseParameters() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::commands::ResponseInfo ui_perform_info( result_ui_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_); @@ -252,7 +253,7 @@ PerformAudioPassThruRequest::PrepareResponseParameters() { } void PerformAudioPassThruRequest::SendSpeakRequest() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace hmi_apis; using namespace smart_objects; @@ -274,7 +275,7 @@ void PerformAudioPassThruRequest::SendSpeakRequest() { } void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); @@ -321,7 +322,7 @@ void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() { } void PerformAudioPassThruRequest::SendRecordStartNotification() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); @@ -331,7 +332,7 @@ void PerformAudioPassThruRequest::SendRecordStartNotification() { } void PerformAudioPassThruRequest::StartMicrophoneRecording() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); uint32_t app_id = connection_key(); application_manager_.BeginAudioPassThru(app_id); @@ -346,7 +347,7 @@ void PerformAudioPassThruRequest::StartMicrophoneRecording() { } bool PerformAudioPassThruRequest::IsWhiteSpaceExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) { @@ -359,7 +360,7 @@ bool PerformAudioPassThruRequest::IsWhiteSpaceExist() { for (; it_ip != it_ip_end; ++it_ip) { str = (*it_ip)[strings::text].asCharArray(); if (std::strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed"); + SDL_LOG_ERROR("Invalid initial_prompt syntax check failed"); return true; } } @@ -370,8 +371,7 @@ bool PerformAudioPassThruRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::audio_pass_display_text1] .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR( - logger_, + SDL_LOG_ERROR( "Invalid audio_pass_display_text1 value syntax check failed"); return true; } @@ -382,8 +382,7 @@ bool PerformAudioPassThruRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::audio_pass_display_text2] .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR( - logger_, + SDL_LOG_ERROR( "Invalid audio_pass_display_text2 value syntax check failed"); return true; } @@ -392,14 +391,14 @@ bool PerformAudioPassThruRequest::IsWhiteSpaceExist() { } void PerformAudioPassThruRequest::FinishTTSSpeak() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); uint32_t app_id = connection_key(); if (application_manager_.EndAudioPassThru(app_id)) { - LOG4CXX_DEBUG(logger_, "Stop AudioPassThru."); + SDL_LOG_DEBUG("Stop AudioPassThru."); application_manager_.StopAudioPassThru(app_id); } if (!IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS)) { - LOG4CXX_WARN(logger_, "TTS Speak is inactive."); + SDL_LOG_WARN("TTS Speak is inactive."); return; } SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL); @@ -446,7 +445,7 @@ PerformAudioPassThruRequest::PrepareAudioPassThruResultCodeForResponse( } bool PerformAudioPassThruRequest::IsWaitingHMIResponse() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) || IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc index 5dae6327eb..8712eae150 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + PerformAudioPassThruResponse::PerformAudioPassThruResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ PerformAudioPassThruResponse::PerformAudioPassThruResponse( PerformAudioPassThruResponse::~PerformAudioPassThruResponse() {} void PerformAudioPassThruResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } 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_; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc index fa02641c2b..c72d851b0e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + PerformInteractionResponse::PerformInteractionResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ PerformInteractionResponse::PerformInteractionResponse( PerformInteractionResponse::~PerformInteractionResponse() {} void PerformInteractionResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc index e25215fb48..50ff392e33 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc @@ -61,6 +61,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + PutFileRequest::PutFileRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -81,7 +83,7 @@ PutFileRequest::PutFileRequest( PutFileRequest::~PutFileRequest() {} void PutFileRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr application = application_manager_.application(connection_key()); @@ -89,7 +91,7 @@ void PutFileRequest::Run() { smart_objects::SmartObject(smart_objects::SmartType_Map); if (!application) { - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -101,8 +103,7 @@ void PutFileRequest::Run() { application->put_file_in_none_count()) { // If application is in the HMI_NONE level the quantity of allowed // PutFile request is limited by the configuration profile - LOG4CXX_ERROR(logger_, - "Too many requests from the app with HMILevel HMI_NONE "); + SDL_LOG_ERROR("Too many requests from the app with HMILevel HMI_NONE "); SendResponse(false, mobile_apis::Result::REJECTED, "Too many requests from the app with HMILevel HMI_NONE", @@ -111,7 +112,7 @@ void PutFileRequest::Run() { } if (!(*message_)[strings::params].keyExists(strings::binary_data)) { - LOG4CXX_ERROR(logger_, "Binary data empty"); + SDL_LOG_ERROR("Binary data empty"); SendResponse(false, mobile_apis::Result::INVALID_DATA, "Binary data empty", @@ -120,7 +121,7 @@ void PutFileRequest::Run() { } if (!(*message_)[strings::msg_params].keyExists(strings::sync_file_name)) { - LOG4CXX_ERROR(logger_, "No file name"); + SDL_LOG_ERROR("No file name"); SendResponse(false, mobile_apis::Result::INVALID_DATA, "No file name", @@ -129,7 +130,7 @@ void PutFileRequest::Run() { } if (!(*message_)[strings::msg_params].keyExists(strings::file_type)) { - LOG4CXX_ERROR(logger_, "No file type"); + SDL_LOG_ERROR("No file type"); SendResponse(false, mobile_apis::Result::INVALID_DATA, "No file type", @@ -141,7 +142,7 @@ void PutFileRequest::Run() { if (!file_system::IsFileNameValid(sync_file_name_)) { const std::string err_msg = "Sync file name contains forbidden symbols."; - LOG4CXX_ERROR(logger_, err_msg); + SDL_LOG_ERROR(err_msg); SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str(), @@ -196,7 +197,7 @@ void PutFileRequest::Run() { response_params[strings::space_available] = static_cast<uint32_t>(space_available); - LOG4CXX_ERROR(logger_, "Out of memory"); + SDL_LOG_ERROR("Out of memory"); SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY, "Out of memory", @@ -206,7 +207,7 @@ void PutFileRequest::Run() { } if (!file_system::CreateDirectoryRecursively(file_path)) { - LOG4CXX_ERROR(logger_, "Can't create folder"); + SDL_LOG_ERROR("Can't create folder"); SendResponse(false, mobile_apis::Result::GENERIC_ERROR, "Can't create folder.", @@ -216,12 +217,12 @@ void PutFileRequest::Run() { const std::string full_path = file_path + "/" + sync_file_name_; if ((*message_)[strings::msg_params].keyExists(strings::crc32_check_sum)) { - LOG4CXX_TRACE(logger_, "Binary Data Size: " << binary_data.size()); + SDL_LOG_TRACE("Binary Data Size: " << binary_data.size()); const uint32_t crc_received = (*message_)[strings::msg_params][strings::crc32_check_sum].asUInt(); - LOG4CXX_TRACE(logger_, "CRC32 SUM Received: " << crc_received); + SDL_LOG_TRACE("CRC32 SUM Received: " << crc_received); const uint32_t crc_calculated = GetCrc32CheckSum(binary_data); - LOG4CXX_TRACE(logger_, "CRC32 SUM Calculated: " << crc_calculated); + SDL_LOG_TRACE("CRC32 SUM Calculated: " << crc_calculated); if (crc_calculated != crc_received) { SendResponse(false, mobile_apis::Result::CORRUPTED_DATA, @@ -232,16 +233,14 @@ void PutFileRequest::Run() { } } - LOG4CXX_DEBUG(logger_, - "Writing " << binary_data.size() << " bytes to " << full_path + SDL_LOG_DEBUG("Writing " << binary_data.size() << " bytes to " << full_path << " (current size is" << file_system::FileSize(full_path) << ")"); mobile_apis::Result::eType save_result = application_manager_.SaveBinary( binary_data, file_path, sync_file_name_, offset_); - LOG4CXX_DEBUG(logger_, - "New size of " << full_path << " is " + SDL_LOG_DEBUG("New size of " << full_path << " is " << file_system::FileSize(full_path) << " bytes"); if (!is_system_file) { response_params[strings::space_available] = @@ -251,7 +250,7 @@ void PutFileRequest::Run() { sync_file_name_ = file_path + "/" + sync_file_name_; switch (save_result) { case mobile_apis::Result::SUCCESS: { - LOG4CXX_INFO(logger_, "PutFile is successful"); + SDL_LOG_INFO("PutFile is successful"); if (!is_system_file) { AppFile file(sync_file_name_, is_persistent_file_, @@ -259,15 +258,14 @@ void PutFileRequest::Run() { file_type_); if (0 == offset_) { - LOG4CXX_INFO(logger_, "New file downloading"); + SDL_LOG_INFO("New file downloading"); if (!application->AddFile(file)) { - LOG4CXX_INFO(logger_, - "Couldn't add file to application (File already Exist" - << " in application and was rewritten on FS)"); + SDL_LOG_INFO("Couldn't add file to application (File already Exist" + << " in application and was rewritten on FS)"); /* It can be first part of new big file, so we need to update information about it's downloading status and persistence */ if (!application->UpdateFile(file)) { - LOG4CXX_ERROR(logger_, "Couldn't update file"); + SDL_LOG_ERROR("Couldn't update file"); /* If it is impossible to update file, application doesn't know about existing this file */ SendResponse(false, @@ -290,15 +288,14 @@ void PutFileRequest::Run() { break; } default: - LOG4CXX_WARN(logger_, - "PutFile is unsuccessful. Result = " << save_result); + SDL_LOG_WARN("PutFile is unsuccessful. Result = " << save_result); SendResponse(false, save_result, "Can't save file", &response_params); break; } } void PutFileRequest::SendOnPutFileNotification(bool is_system_file) { - LOG4CXX_INFO(logger_, "SendOnPutFileNotification"); + SDL_LOG_INFO("SendOnPutFileNotification"); smart_objects::SmartObjectSPtr notification = std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc index f9ddbf7717..493efbd11c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + PutFileResponse::PutFileResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,12 +57,12 @@ PutFileResponse::PutFileResponse( PutFileResponse::~PutFileResponse() {} void PutFileResponse::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); if (!app) { - LOG4CXX_ERROR(logger_, "Application not registered"); + SDL_LOG_ERROR("Application not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc index bd36f060ed..2b7ceefa66 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc @@ -178,6 +178,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + RegisterAppInterfaceRequest::RegisterAppInterfaceRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -195,14 +197,14 @@ RegisterAppInterfaceRequest::RegisterAppInterfaceRequest( RegisterAppInterfaceRequest::~RegisterAppInterfaceRequest() {} bool RegisterAppInterfaceRequest::Init() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); return true; } void RegisterAppInterfaceRequest::Run() { using namespace helpers; - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Connection key is " << connection_key()); + SDL_LOG_AUTO_TRACE(); + SDL_LOG_DEBUG("Connection key is " << connection_key()); // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA. // Flag conditional compilation specific to customer is used in order to @@ -213,12 +215,10 @@ void RegisterAppInterfaceRequest::Run() { // wait till HMI started while (!application_manager_.IsStopping() && !application_manager_.IsHMICooperating()) { - LOG4CXX_DEBUG(logger_, - "Waiting for the HMI... conn_key=" - << connection_key() - << ", correlation_id=" << correlation_id() - << ", default_timeout=" << default_timeout() - << ", thread=" << pthread_self()); + SDL_LOG_DEBUG("Waiting for the HMI... conn_key=" + << connection_key() << ", correlation_id=" << correlation_id() + << ", default_timeout=" << default_timeout() + << ", thread=" << pthread_self()); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); sleep(1); @@ -226,7 +226,7 @@ void RegisterAppInterfaceRequest::Run() { } if (application_manager_.IsStopping()) { - LOG4CXX_WARN(logger_, "The ApplicationManager is stopping!"); + SDL_LOG_WARN("The ApplicationManager is stopping!"); return; } @@ -247,9 +247,8 @@ void RegisterAppInterfaceRequest::Run() { return; } - LOG4CXX_DEBUG( - logger_, - "device_handle: " << device_handle_ << " device_id: " << device_id_); + SDL_LOG_DEBUG("device_handle: " << device_handle_ + << " device_id: " << device_id_); if (IsApplicationSwitched()) { return; @@ -304,8 +303,7 @@ void RegisterAppInterfaceRequest::Run() { std::vector<ApplicationSharedPtr> duplicate_apps; if (GetDuplicateNames(duplicate_apps)) { - LOG4CXX_ERROR(logger_, - "Found duplicate app names, checking for hybrid apps."); + SDL_LOG_ERROR("Found duplicate app names, checking for hybrid apps."); // Default preference to BOTH mobile_apis::HybridAppPreference::eType preference = mobile_apis::HybridAppPreference::BOTH; @@ -344,8 +342,7 @@ void RegisterAppInterfaceRequest::Run() { preference == mobile_apis::HybridAppPreference::CLOUD) { // Unregister mobile application and allow cloud application to // register in it's place - LOG4CXX_ERROR( - logger_, + SDL_LOG_ERROR( "Unregistering app because a preferred version is registered."); application_manager_.UnregisterApplication( duplicate_app->app_id(), @@ -371,14 +368,13 @@ void RegisterAppInterfaceRequest::Run() { } if (mobile_apis::Result::SUCCESS != coincidence_result) { - LOG4CXX_ERROR(logger_, "Coincidence check failed."); + SDL_LOG_ERROR("Coincidence check failed."); SendResponse(false, coincidence_result); return; } if (IsWhiteSpaceExist()) { - LOG4CXX_INFO(logger_, - "Incoming register app interface has contains \t\n \\t \\n"); + SDL_LOG_INFO("Incoming register app interface has contains \t\n \\t \\n"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -399,15 +395,14 @@ void RegisterAppInterfaceRequest::Run() { minimum_major_version, minimum_minor_version, minimum_patch_version); if (mobile_version < min_module_version) { - LOG4CXX_WARN(logger_, - "Application RPC Version does not meet minimum requirement"); + SDL_LOG_WARN("Application RPC Version does not meet minimum requirement"); SendResponse(false, mobile_apis::Result::REJECTED); } application = application_manager_.RegisterApplication(message_); if (!application) { - LOG4CXX_ERROR(logger_, "Application hasn't been registered!"); + SDL_LOG_ERROR("Application hasn't been registered!"); return; } @@ -446,9 +441,8 @@ void RegisterAppInterfaceRequest::Run() { tts_name, application, 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); response_info_ = "One or more files needed for tts_name are not present"; result_code_ = mobile_apis::Result::WARNINGS; } @@ -517,9 +511,8 @@ void RegisterAppInterfaceRequest::Run() { NULL, &dev_params.device_mac_address, &dev_params.device_connection_type)) { - LOG4CXX_ERROR( - logger_, - "Failed to extract information for device " << application->device()); + SDL_LOG_ERROR("Failed to extract information for device " + << application->device()); } policy::DeviceInfo device_info; device_info.AdoptDeviceType(dev_params.device_connection_type); @@ -690,7 +683,7 @@ void FillUIRelatedFields(smart_objects::SmartObject& response_params, void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( ApplicationType app_type) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject response_params(smart_objects::SmartType_Map); mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS; @@ -703,9 +696,8 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( resumption::ResumeCtrl& resumer = application_manager_.resume_controller(); if (!application) { - LOG4CXX_ERROR(logger_, - "There is no application for such connection key" << key); - LOG4CXX_DEBUG(logger_, "Need to start resume data persistent timer"); + SDL_LOG_ERROR("There is no application for such connection key " << key); + SDL_LOG_DEBUG("Need to start resume data persistent timer"); resumer.OnAppRegistrationEnd(); return; } @@ -726,19 +718,17 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( hmi_capabilities.active_vr_language() || msg_params[strings::hmi_display_language_desired].asInt() != hmi_capabilities.active_ui_language()) { - LOG4CXX_WARN(logger_, - "Wrong language on registering application " - << application->name().c_str()); - - LOG4CXX_ERROR( - logger_, - "VR language desired code is " - << msg_params[strings::language_desired].asInt() - << " , active VR language code is " - << hmi_capabilities.active_vr_language() << ", UI language code is " - << msg_params[strings::hmi_display_language_desired].asInt() - << " , active UI language code is " - << hmi_capabilities.active_ui_language()); + SDL_LOG_WARN("Wrong language on registering application " + << application->name().c_str()); + + SDL_LOG_ERROR("VR language desired code is " + << msg_params[strings::language_desired].asInt() + << " , active VR language code is " + << hmi_capabilities.active_vr_language() + << ", UI language code is " + << msg_params[strings::hmi_display_language_desired].asInt() + << " , active UI language code is " + << hmi_capabilities.active_ui_language()); result_code = mobile_apis::Result::WRONG_LANGUAGE; } @@ -821,9 +811,9 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( } if (ApplicationType::kSwitchedApplicationWrongHashId == app_type) { - LOG4CXX_DEBUG(logger_, - "Application has been switched from another transport, " - "but doesn't have correct hashID."); + SDL_LOG_DEBUG( + "Application has been switched from another transport, " + "but doesn't have correct hashID."); application_manager::DeleteApplicationData(application, application_manager_); @@ -834,9 +824,9 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( } if (ApplicationType::kSwitchedApplicationHashOk == app_type) { - LOG4CXX_DEBUG(logger_, - "Application has been switched from another transport " - "and has correct hashID."); + SDL_LOG_DEBUG( + "Application has been switched from another transport " + "and has correct hashID."); SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params); return; } @@ -852,13 +842,12 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( std::string add_info; if (resumption) { if (!resumer.CheckApplicationHash(application, hash_id)) { - LOG4CXX_WARN(logger_, - "Hash from RAI does not match to saved resume data."); + SDL_LOG_WARN("Hash from RAI does not match to saved resume data."); result_code = mobile_apis::Result::RESUME_FAILED; add_info = "Hash from RAI does not match to saved resume data."; need_restore_vr = false; } else if (!resumer.CheckPersistenceFilesForResumption(application)) { - LOG4CXX_WARN(logger_, "Persistent data is missing."); + SDL_LOG_WARN("Persistent data is missing."); result_code = mobile_apis::Result::RESUME_FAILED; add_info = "Persistent data is missing."; need_restore_vr = false; @@ -962,7 +951,7 @@ void RegisterAppInterfaceRequest::SendChangeRegistration( msg_params[strings::app_id] = app_id; SendHMIRequest(function_id, &msg_params); } else { - LOG4CXX_DEBUG(logger_, "Interface " << interface << "is not avaliable"); + SDL_LOG_DEBUG("Interface " << interface << " is not available"); } } @@ -982,7 +971,7 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( using namespace smart_objects; SmartObjectSPtr notification = std::make_shared<SmartObject>(SmartType_Map); if (!notification) { - LOG4CXX_ERROR(logger_, "Failed to create smart object"); + SDL_LOG_ERROR("Failed to create smart object"); return; } @@ -1032,7 +1021,7 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( } mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; @@ -1054,7 +1043,7 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() { // Name check const auto& cur_name = app->name(); if (app_name.CompareIgnoreCase(cur_name)) { - LOG4CXX_ERROR(logger_, "Application name is known already."); + SDL_LOG_ERROR("Application name is known already."); return mobile_apis::Result::DUPLICATE_NAME; } const auto vr = app->vr_synonyms(); @@ -1063,7 +1052,7 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() { CoincidencePredicateVR v(app_name); if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) { - LOG4CXX_ERROR(logger_, "Application name is known already."); + SDL_LOG_ERROR("Application name is known already."); return mobile_apis::Result::DUPLICATE_NAME; } } @@ -1074,7 +1063,7 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() { CoincidencePredicateVR v(cur_name); if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) { - LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name ."); + SDL_LOG_ERROR("vr_synonyms duplicated with app_name ."); return mobile_apis::Result::DUPLICATE_NAME; } } // End vr check @@ -1089,11 +1078,9 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() { tts_curr->end(), compare_tts_name); if (it_tts != tts_array->end()) { - LOG4CXX_ERROR( - logger_, - "TTS name: " - << (*it_tts)[strings::text].asCustomString().AsMBString() - << " is known already"); + SDL_LOG_ERROR("TTS name: " + << (*it_tts)[strings::text].asCustomString().AsMBString() + << " is known already"); return mobile_apis::Result::DUPLICATE_NAME; } } // End tts check @@ -1105,7 +1092,7 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() { bool RegisterAppInterfaceRequest::GetDuplicateNames( std::vector<ApplicationSharedPtr>& out_duplicate_apps) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; @@ -1139,7 +1126,7 @@ bool RegisterAppInterfaceRequest::GetDuplicateNames( } mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); // TODO(AOleynik): Check is necessary to allow register application in case // of disabled policy // Remove this check, when HMI will support policy @@ -1157,7 +1144,7 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() { mobile_app_id, &app_nicknames, &app_hmi_types_in_policy); if (!init_result) { - LOG4CXX_ERROR(logger_, "Error during initial application data check."); + SDL_LOG_ERROR("Error during initial application data check."); return mobile_apis::Result::INVALID_DATA; } @@ -1167,8 +1154,7 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() { policy::StringArray::const_iterator it = std::find_if(app_nicknames.begin(), app_nicknames.end(), compare); if (app_nicknames.end() == it) { - LOG4CXX_WARN(logger_, - "Application name was not found in nicknames list."); + SDL_LOG_WARN("Application name was not found in nicknames list."); // App should be unregistered, if its name is not present in nicknames // list usage_statistics::AppCounter count_of_rejections_nickname_mismatch( @@ -1191,7 +1177,7 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() { response_info_ = "WEB_VIEW AppHmiType is absent in application policies, because they " "are empty"; - LOG4CXX_DEBUG(logger_, response_info_); + SDL_LOG_DEBUG(response_info_); return result; } } @@ -1238,7 +1224,7 @@ void RegisterAppInterfaceRequest::FillDeviceInfo( } bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const custom_string::CustomString mobile_app_id( application_manager_.GetCorrectMobileIDFromMessage(message_)); @@ -1248,12 +1234,11 @@ bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() { for (const auto& app : applications) { if (mobile_app_id.CompareIgnoreCase(app->policy_app_id().c_str())) { if (app->device() != device_handle_) { - LOG4CXX_DEBUG(logger_, - "These policy_app_id equal, but applications have " - "different device id" - << " mobile_app_id: " << mobile_app_id.c_str() - << " device_handle: " << device_handle_ - << " device_handle: " << app->device()); + SDL_LOG_DEBUG( + "These policy_app_id equal, but applications have " + "different device id" + << " mobile_app_id: " << mobile_app_id.c_str() << " device_handle: " + << device_handle_ << " device_handle: " << app->device()); continue; } return true; @@ -1264,12 +1249,12 @@ bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() { } bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; str = (*message_)[strings::msg_params][strings::app_name].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed"); + SDL_LOG_ERROR("Invalid app_name syntax check failed"); return true; } @@ -1283,7 +1268,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { for (; it_tn != it_tn_end; ++it_tn) { str = (*it_tn)[strings::text].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed"); + SDL_LOG_ERROR("Invalid tts_name syntax check failed"); return true; } } @@ -1294,8 +1279,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::ngn_media_screen_app_name] .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid ngn_media_screen_app_name syntax check failed"); + SDL_LOG_ERROR("Invalid ngn_media_screen_app_name syntax check failed"); return true; } } @@ -1310,7 +1294,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { for (; it_vs != it_vs_end; ++it_vs) { str = (*it_vs).asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed"); + SDL_LOG_ERROR("Invalid vr_synonyms syntax check failed"); return true; } } @@ -1319,7 +1303,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) { str = (*message_)[strings::msg_params][strings::hash_id].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid hash_id syntax check failed"); + SDL_LOG_ERROR("Invalid hash_id syntax check failed"); return true; } } @@ -1331,8 +1315,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { [strings::hardware] .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid device_info hardware syntax check failed"); + SDL_LOG_ERROR("Invalid device_info hardware syntax check failed"); return true; } } @@ -1343,8 +1326,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { [strings::firmware_rev] .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid device_info firmware_rev syntax check failed"); + SDL_LOG_ERROR("Invalid device_info firmware_rev syntax check failed"); return true; } } @@ -1354,7 +1336,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::device_info][strings::os] .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid device_info os syntax check failed"); + SDL_LOG_ERROR("Invalid device_info os syntax check failed"); return true; } } @@ -1365,8 +1347,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { [strings::os_version] .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid device_info os_version syntax check failed"); + SDL_LOG_ERROR("Invalid device_info os_version syntax check failed"); return true; } } @@ -1377,8 +1358,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { [strings::carrier] .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid device_info carrier syntax check failed"); + SDL_LOG_ERROR("Invalid device_info carrier syntax check failed"); return true; } } @@ -1387,7 +1367,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { if ((*message_)[strings::msg_params].keyExists(strings::app_id)) { str = (*message_)[strings::msg_params][strings::app_id].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid app_id syntax check failed"); + SDL_LOG_ERROR("Invalid app_id syntax check failed"); return true; } } @@ -1397,7 +1377,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::full_app_id].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid app_id syntax check failed"); + SDL_LOG_ERROR("Invalid app_id syntax check failed"); return true; } } @@ -1413,8 +1393,7 @@ void RegisterAppInterfaceRequest::CheckResponseVehicleTypeParam( using namespace hmi_response; if (!vehicle_type.keyExists(param) || vehicle_type[param].empty()) { if (!backup_value.empty()) { - LOG4CXX_DEBUG(logger_, - param << " is missing." + SDL_LOG_DEBUG(param << " is missing." "Will be replaced with policy table value."); vehicle_type[param] = backup_value; } else { @@ -1437,30 +1416,27 @@ bool RegisterAppInterfaceRequest::IsApplicationSwitched() { const std::string& policy_app_id = application_manager_.GetCorrectMobileIDFromMessage(message_); - LOG4CXX_DEBUG(logger_, "Looking for application id " << policy_app_id); + SDL_LOG_DEBUG("Looking for application id " << policy_app_id); auto app = application_manager_.reregister_application_by_policy_id(policy_app_id); if (!app) { - LOG4CXX_DEBUG( - logger_, - "Application with policy id " << policy_app_id << " is not found."); + SDL_LOG_DEBUG("Application with policy id " << policy_app_id + << " is not found."); return false; } - LOG4CXX_DEBUG(logger_, - "Application with policy id " << policy_app_id << " is found."); + SDL_LOG_DEBUG("Application with policy id " << policy_app_id << " is found."); const auto app_device_handle = app->device(); if (app_device_handle == device_handle_) { - LOG4CXX_DEBUG(logger_, - "Application " << policy_app_id + SDL_LOG_DEBUG("Application " << policy_app_id << " is already registered from this device."); SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY); return true; } - LOG4CXX_DEBUG(logger_, "Application is found in reconnection list."); + SDL_LOG_DEBUG("Application is found in reconnection list."); auto app_type = ApplicationType::kSwitchedApplicationWrongHashId; if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) { @@ -1490,12 +1466,12 @@ bool RegisterAppInterfaceRequest::GetDataOnSessionKey( const uint32_t key, connection_handler::DeviceHandle* device_id, std::string* mac_address) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if ((nullptr == mac_address) && (nullptr == device_id)) { - LOG4CXX_ERROR(logger_, - "Can't get data on session key because device id and mac " - "address are empty."); + SDL_LOG_ERROR( + "Can't get data on session key because device id and mac " + "address are empty."); return false; } @@ -1506,8 +1482,7 @@ bool RegisterAppInterfaceRequest::GetDataOnSessionKey( connection_key(), nullptr, nullptr, &device_handle); if (result) { - LOG4CXX_DEBUG( - logger_, + SDL_LOG_DEBUG( "Failed to get device info for connection key: " << connection_key()); return false; } @@ -1518,9 +1493,8 @@ bool RegisterAppInterfaceRequest::GetDataOnSessionKey( } if (result) { - LOG4CXX_DEBUG(logger_, - "Failed get unique address info for connection key: " - << connection_key()); + SDL_LOG_DEBUG("Failed get unique address info for connection key: " + << connection_key()); return false; } @@ -1582,7 +1556,7 @@ RegisterAppInterfaceRequest::ProcessingAppHMITypesPolicies( if (mobile_apis::Result::DISALLOWED == result) { response_info_ = "WEB_VIEW AppHmiType is absent in application policies"; - LOG4CXX_DEBUG(logger_, response_info_); + SDL_LOG_DEBUG(response_info_); return result; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc index b5683c62cb..f0e885f54c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc @@ -42,8 +42,10 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + void RegisterAppInterfaceResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); mobile_apis::Result::eType result_code = mobile_apis::Result::SUCCESS; bool success = (*message_)[strings::msg_params][strings::success].asBool(); @@ -102,8 +104,7 @@ void RegisterAppInterfaceResponse::Run() { // Add registered application to the policy db right after response sent to // mobile to be able to check all other API according to app permissions if (!app) { - LOG4CXX_ERROR(logger_, - "Application with connection key " << connection_key() + SDL_LOG_ERROR("Application with connection key " << connection_key() << " is not registered."); return; } @@ -113,7 +114,7 @@ void RegisterAppInterfaceResponse::Run() { void RegisterAppInterfaceResponse::SetHeartBeatTimeout( uint32_t connection_key, const std::string& mobile_app_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); policy::PolicyHandlerInterface& policy_handler = policy_handler_; if (policy_handler.PolicyEnabled()) { const uint32_t timeout = policy_handler.HeartBeatTimeout(mobile_app_id); @@ -122,7 +123,7 @@ void RegisterAppInterfaceResponse::SetHeartBeatTimeout( connection_key, timeout); } } else { - LOG4CXX_INFO(logger_, "Policy is turn off"); + SDL_LOG_INFO("Policy is turn off"); } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc index a0e178d0e2..48ca41a0e6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc @@ -44,6 +44,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ResetGlobalPropertiesRequest::ResetGlobalPropertiesRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -61,14 +63,14 @@ ResetGlobalPropertiesRequest::ResetGlobalPropertiesRequest( ResetGlobalPropertiesRequest::~ResetGlobalPropertiesRequest() {} void ResetGlobalPropertiesRequest::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); if (!app) { - LOG4CXX_ERROR(logger_, "No application associated with session key"); + SDL_LOG_ERROR("No application associated with session key"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -77,7 +79,7 @@ void ResetGlobalPropertiesRequest::Run() { (*message_)[strings::msg_params][strings::properties].length(); // if application waits for sending ttsGlobalProperties need to remove this // application from tts_global_properties_app_list_ - LOG4CXX_INFO(logger_, "RemoveAppFromTTSGlobalPropertiesList"); + SDL_LOG_INFO("RemoveAppFromTTSGlobalPropertiesList"); application_manager_.RemoveAppFromTTSGlobalPropertiesList(app_id); bool helpt_promt = false; @@ -194,7 +196,7 @@ void ResetGlobalPropertiesRequest::Run() { bool ResetGlobalPropertiesRequest::ResetHelpPromt( application_manager::ApplicationSharedPtr app) { if (!app) { - LOG4CXX_ERROR(logger_, "Null pointer"); + SDL_LOG_ERROR("Null pointer"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return false; } @@ -220,7 +222,7 @@ bool ResetGlobalPropertiesRequest::ResetHelpPromt( bool ResetGlobalPropertiesRequest::ResetTimeoutPromt( application_manager::ApplicationSharedPtr const app) { if (!app) { - LOG4CXX_ERROR(logger_, "Null pointer"); + SDL_LOG_ERROR("Null pointer"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return false; } @@ -247,7 +249,7 @@ bool ResetGlobalPropertiesRequest::ResetTimeoutPromt( bool ResetGlobalPropertiesRequest::ResetVrHelpTitleItems( application_manager::ApplicationSharedPtr const app) { if (!app) { - LOG4CXX_ERROR(logger_, "Null pointer"); + SDL_LOG_ERROR("Null pointer"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return false; } @@ -266,12 +268,12 @@ bool ResetGlobalPropertiesRequest::ResetVrHelpTitleItems( } void ResetGlobalPropertiesRequest::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_SetGlobalProperties: { - LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event"); + SDL_LOG_INFO("Received UI_SetGlobalProperties event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); ui_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); @@ -279,7 +281,7 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::TTS_SetGlobalProperties: { - LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event"); + SDL_LOG_INFO("Received TTS_SetGlobalProperties event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); tts_result_ = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); @@ -287,13 +289,13 @@ void ResetGlobalPropertiesRequest::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; } } if (IsPendingResponseExist()) { - LOG4CXX_DEBUG(logger_, "Waiting for remaining responses"); + SDL_LOG_DEBUG("Waiting for remaining responses"); return; } @@ -315,7 +317,7 @@ bool ResetGlobalPropertiesRequest::Init() { bool ResetGlobalPropertiesRequest::PrepareResponseParameters( mobile_apis::Result::eType& out_result_code, std::string& out_response_info) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace helpers; bool result = false; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc index 07aa23d9c9..ef1ba4f77a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ResetGlobalPropertiesResponse::ResetGlobalPropertiesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ ResetGlobalPropertiesResponse::ResetGlobalPropertiesResponse( ResetGlobalPropertiesResponse::~ResetGlobalPropertiesResponse() {} void ResetGlobalPropertiesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc index 90dbb91b5f..89e77d9d19 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc @@ -46,6 +46,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ScrollableMessageRequest::ScrollableMessageRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -73,12 +75,12 @@ bool ScrollableMessageRequest::Init() { } void ScrollableMessageRequest::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; } @@ -92,7 +94,7 @@ void ScrollableMessageRequest::Run() { application_manager_); if (mobile_apis::Result::SUCCESS != processing_result) { - LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!"); + SDL_LOG_ERROR("Wrong soft buttons parameters!"); SendResponse(false, processing_result); return; } @@ -125,18 +127,18 @@ void ScrollableMessageRequest::Run() { } void ScrollableMessageRequest::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_INFO(logger_, "Received UI_OnResetTimeout event"); + SDL_LOG_INFO("Received UI_OnResetTimeout event"); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); break; } case hmi_apis::FunctionID::UI_ScrollableMessage: { - LOG4CXX_INFO(logger_, "Received UI_ScrollableMessage event"); + SDL_LOG_INFO("Received UI_ScrollableMessage event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); hmi_apis::Common_Result::eType result_code = @@ -155,7 +157,7 @@ void ScrollableMessageRequest::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; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc index 6236506c00..a6f980b9ba 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ScrollableMessageResponse::ScrollableMessageResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ ScrollableMessageResponse::ScrollableMessageResponse( policy_handler) {} void ScrollableMessageResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); mobile_apis::Result::eType result_code = static_cast<mobile_apis::Result::eType>( (*message_)[strings::msg_params][strings::result_code].asInt()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc index 6e745fe0db..aa5e1077ca 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + namespace custom_str = utils::custom_string; SendHapticDataRequest::SendHapticDataRequest( @@ -55,14 +57,14 @@ SendHapticDataRequest::SendHapticDataRequest( SendHapticDataRequest::~SendHapticDataRequest() {} void SendHapticDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; 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,7 +79,7 @@ void SendHapticDataRequest::Run() { } void SendHapticDataRequest::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(); @@ -97,7 +99,7 @@ void SendHapticDataRequest::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/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc index 79a0516928..57e63dbb7c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SendHapticDataResponse::SendHapticDataResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,7 +55,7 @@ SendHapticDataResponse::SendHapticDataResponse( SendHapticDataResponse::~SendHapticDataResponse() {} void SendHapticDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc index 805c0f0e41..37d43a354b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SendLocationRequest::SendLocationRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -57,14 +59,13 @@ SendLocationRequest::~SendLocationRequest() {} void SendLocationRequest::Run() { using namespace hmi_apis; using smart_objects::SmartObject; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, - "An application with connection key " - << connection_key() << " is not registered."); + SDL_LOG_ERROR("An application with connection key " + << connection_key() << " is not registered."); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -98,7 +99,7 @@ void SendLocationRequest::Run() { } if (IsWhiteSpaceExist()) { - LOG4CXX_ERROR(logger_, "Strings contain invalid characters"); + SDL_LOG_ERROR("Strings contain invalid characters"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -112,7 +113,7 @@ void SendLocationRequest::Run() { } if (!CheckFieldsCompatibility()) { - LOG4CXX_ERROR(logger_, "CheckFieldsCompatibility failed"); + SDL_LOG_ERROR("CheckFieldsCompatibility failed"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -125,7 +126,7 @@ void SendLocationRequest::Run() { app, application_manager_); if (mobile_apis::Result::INVALID_DATA == verification_result) { - LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!"); + SDL_LOG_ERROR("VerifyImage INVALID_DATA!"); SendResponse(false, verification_result); return; } @@ -140,11 +141,11 @@ void SendLocationRequest::Run() { } void SendLocationRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace hmi_apis; const smart_objects::SmartObject& message = event.smart_object(); if (hmi_apis::FunctionID::Navigation_SendLocation == event.id()) { - LOG4CXX_INFO(logger_, "Received Navigation_SendLocation event"); + SDL_LOG_INFO("Received Navigation_SendLocation event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const Common_Result::eType result_code = static_cast<Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); @@ -158,7 +159,7 @@ void SendLocationRequest::on_event(const event_engine::Event& event) { &(message[strings::params])); return; } - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SDL_LOG_ERROR("Received unknown event " << event.id()); } bool SendLocationRequest::CheckFieldsCompatibility() { @@ -172,14 +173,12 @@ bool SendLocationRequest::CheckFieldsCompatibility() { const bool address_exist = msg_params.keyExists(strings::address); if (latitude_degrees_exist ^ longitude_degrees_exist) { - LOG4CXX_DEBUG(logger_, - "latitude and longitude should be provided only in pair"); + SDL_LOG_DEBUG("latitude and longitude should be provided only in pair"); return false; } if (!address_exist && !longitude_degrees_exist && !latitude_degrees_exist) { - LOG4CXX_DEBUG(logger_, - "address or latitude/longtitude should should be provided"); + SDL_LOG_DEBUG("address or latitude/longtitude should should be provided"); return false; } return true; @@ -194,7 +193,7 @@ void insert_if_contains( } bool SendLocationRequest::IsWhiteSpaceExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::vector<utils::custom_string::CustomString> fields_to_check; const smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; @@ -232,8 +231,7 @@ bool SendLocationRequest::IsWhiteSpaceExist() { for (; it != fields_to_check.end(); ++it) { const std::string& str = it->AsMBString(); if (!CheckSyntax(str, false)) { - LOG4CXX_ERROR(logger_, - "string '" << str << "'' contains invalid characters"); + SDL_LOG_ERROR("string '" << str << "'' contains invalid characters"); return true; } } @@ -250,7 +248,7 @@ bool SendLocationRequest::CheckHMICapabilities( const HMICapabilities& hmi_capabilities = hmi_capabilities_; if (!hmi_capabilities.is_ui_cooperating()) { - LOG4CXX_ERROR(logger_, "UI is not supported."); + SDL_LOG_ERROR("UI is not supported."); return false; } @@ -273,7 +271,7 @@ bool SendLocationRequest::CheckHMICapabilities( } if (!fields_names.empty()) { - LOG4CXX_ERROR(logger_, "Some fields are not supported by capabilities"); + SDL_LOG_ERROR("Some fields are not supported by capabilities"); return false; } return true; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc index 934008b816..fcf1a0f406 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SendLocationResponse::SendLocationResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ SendLocationResponse::SendLocationResponse( SendLocationResponse::~SendLocationResponse() {} void SendLocationResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc index ed77d8a550..9f30478111 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc @@ -46,6 +46,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SetAppIconRequest::SetAppIconRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -62,9 +64,9 @@ SetAppIconRequest::SetAppIconRequest( application_manager_.get_settings().app_icons_folder(); if (!file_system::DirectoryExists(path)) { - LOG4CXX_WARN(logger_, "App icons folder doesn't exist."); + SDL_LOG_WARN("App icons folder doesn't exist."); if (!file_system::CreateDirectoryRecursively(path)) { - LOG4CXX_ERROR(logger_, "Unable to create app icons directory: " << path); + SDL_LOG_ERROR("Unable to create app icons directory: " << path); } } @@ -75,12 +77,12 @@ SetAppIconRequest::SetAppIconRequest( SetAppIconRequest::~SetAppIconRequest() {} void SetAppIconRequest::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; } @@ -90,7 +92,7 @@ void SetAppIconRequest::Run() { if (!file_system::IsFileNameValid(sync_file_name)) { const std::string err_msg = "Sync file name contains forbidden symbols."; - LOG4CXX_ERROR(logger_, err_msg); + SDL_LOG_ERROR(err_msg); SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str()); return; } @@ -102,7 +104,7 @@ void SetAppIconRequest::Run() { full_file_path += sync_file_name; if (!file_system::FileExists(full_file_path)) { - LOG4CXX_ERROR(logger_, "No such file " << full_file_path); + SDL_LOG_ERROR("No such file " << full_file_path); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -129,19 +131,18 @@ void SetAppIconRequest::Run() { void SetAppIconRequest::CopyToIconStorage( const std::string& policy_app_id, const std::string& path_to_file) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!(application_manager_.protocol_handler() .get_settings() .max_supported_protocol_version() >= protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4)) { - LOG4CXX_WARN(logger_, - "Icon copying skipped, since protocol ver. 4 is not enabled."); + SDL_LOG_WARN("Icon copying skipped, since protocol ver. 4 is not enabled."); return; } std::vector<uint8_t> file_content; if (!file_system::ReadBinaryFile(path_to_file, file_content)) { - LOG4CXX_ERROR(logger_, "Can't read icon file: " << path_to_file); + SDL_LOG_ERROR("Can't read icon file: " << path_to_file); return; } @@ -152,13 +153,12 @@ void SetAppIconRequest::CopyToIconStorage( const uint64_t file_size = file_system::FileSize(path_to_file); if (0 == file_size) { - LOG4CXX_ERROR(logger_, "Can't get the icon file size: " << path_to_file); + SDL_LOG_ERROR("Can't get the icon file size: " << path_to_file); return; } if (storage_max_size < file_size) { - LOG4CXX_ERROR(logger_, - "Icon size (" << file_size + SDL_LOG_ERROR("Icon size (" << file_size << ") is bigger, than " " icons storage maximum size (" << storage_max_size @@ -175,9 +175,9 @@ void SetAppIconRequest::CopyToIconStorage( application_manager_.get_settings().app_icons_amount_to_remove(); if (!icons_amount) { - LOG4CXX_DEBUG(logger_, - "No icons will be deleted, since amount icons to remove " - "is zero. Icon saving skipped."); + SDL_LOG_DEBUG( + "No icons will be deleted, since amount icons to remove " + "is zero. Icon saving skipped."); return; } @@ -189,17 +189,16 @@ void SetAppIconRequest::CopyToIconStorage( const std::string icon_path = icon_storage + "/" + policy_app_id; if (!file_system::CreateFile(icon_path)) { - LOG4CXX_ERROR(logger_, "Can't create icon: " << icon_path); + SDL_LOG_ERROR("Can't create icon: " << icon_path); return; } if (!file_system::WriteBinaryFile(icon_path, file_content)) { - LOG4CXX_ERROR(logger_, "Can't write icon: " << icon_path); + SDL_LOG_ERROR("Can't write icon: " << icon_path); return; } - LOG4CXX_DEBUG(logger_, - "Icon was successfully copied from :" << path_to_file << " to " + SDL_LOG_DEBUG("Icon was successfully copied from :" << path_to_file << " to " << icon_path); return; @@ -227,17 +226,16 @@ void SetAppIconRequest::RemoveOldestIcons(const std::string& storage, for (size_t counter = 0; counter < icons_amount; ++counter) { if (!icon_modification_time.size()) { - LOG4CXX_ERROR(logger_, "No more icons left for deletion."); + SDL_LOG_ERROR("No more icons left for deletion."); return; } const std::string file_name = icon_modification_time.begin()->second; const std::string file_path = storage + "/" + file_name; if (!file_system::DeleteFile(file_path)) { - LOG4CXX_DEBUG(logger_, "Error while deleting icon " << file_path); + SDL_LOG_DEBUG("Error while deleting icon " << file_path); } icon_modification_time.erase(icon_modification_time.begin()); - LOG4CXX_DEBUG(logger_, - "Old icon " << file_path << " was deleted successfully."); + SDL_LOG_DEBUG("Old icon " << file_path << " was deleted successfully."); } } @@ -252,7 +250,7 @@ bool SetAppIconRequest::IsEnoughSpaceForIcon(const uint64_t icon_size) const { } void SetAppIconRequest::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()) { @@ -270,8 +268,7 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) { application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR( - logger_, + SDL_LOG_ERROR( "Can't get application for connection key: " << connection_key()); return; } @@ -283,8 +280,7 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) { app->set_app_icon_path(full_file_path_for_hmi_); - LOG4CXX_INFO(logger_, - "Icon path was set to '" << app->app_icon_path() << "'"); + SDL_LOG_INFO("Icon path was set to '" << app->app_icon_path() << "'"); } SendResponse(result, @@ -294,7 +290,7 @@ void SetAppIconRequest::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/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc index 55255920d0..350d120f10 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SetAppIconResponse::SetAppIconResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ SetAppIconResponse::SetAppIconResponse( SetAppIconResponse::~SetAppIconResponse() {} void SetAppIconResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc index 680429d3b6..45ff0078fb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc @@ -7,6 +7,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SetCloudAppPropertiesRequest::SetCloudAppPropertiesRequest( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, @@ -22,11 +24,11 @@ SetCloudAppPropertiesRequest::SetCloudAppPropertiesRequest( SetCloudAppPropertiesRequest::~SetCloudAppPropertiesRequest() {} void SetCloudAppPropertiesRequest::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; } @@ -58,7 +60,7 @@ void SetCloudAppPropertiesRequest::Run() { void SetCloudAppPropertiesRequest::on_event( const app_mngr::event_engine::Event& event) { - LOG4CXX_INFO(logger_, "SetCloudAppPropertiesRequest on_event"); + SDL_LOG_INFO("SetCloudAppPropertiesRequest on_event"); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_response.cc index 39d2ea7f90..1529788544 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_response.cc @@ -7,6 +7,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SetCloudAppPropertiesResponse::SetCloudAppPropertiesResponse( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, @@ -22,7 +24,7 @@ SetCloudAppPropertiesResponse::SetCloudAppPropertiesResponse( SetCloudAppPropertiesResponse::~SetCloudAppPropertiesResponse() {} void SetCloudAppPropertiesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc index 0cd9f6635c..b2ca3e6cfa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SetDisplayLayoutRequest::SetDisplayLayoutRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,11 +58,11 @@ SetDisplayLayoutRequest::SetDisplayLayoutRequest( SetDisplayLayoutRequest::~SetDisplayLayoutRequest() {} void SetDisplayLayoutRequest::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,11 +79,10 @@ void SetDisplayLayoutRequest::Run() { if (new_layout != old_layout && !new_layout.empty()) { // Template switched, hence allow any color change - LOG4CXX_DEBUG(logger_, - "SetDisplayLayoutRequest New Layout: " << new_layout); + SDL_LOG_DEBUG("SetDisplayLayoutRequest New Layout: " << new_layout); app->set_display_layout(new_layout); } else { - LOG4CXX_DEBUG(logger_, "SetDisplayLayoutRequest No Layout Change"); + SDL_LOG_DEBUG("SetDisplayLayoutRequest No Layout Change"); // Template layout is the same as previous layout // Reject message if colors are set if (msg_params.keyExists(strings::day_color_scheme) && @@ -89,7 +90,7 @@ void SetDisplayLayoutRequest::Run() { msg_params[strings::day_color_scheme] != app->day_color_scheme()) { // Color scheme param exists and has been previously set, // hence do not allow color change - LOG4CXX_DEBUG(logger_, "Reject Day Color Scheme Change"); + SDL_LOG_DEBUG("Reject Day Color Scheme Change"); SendResponse(false, mobile_apis::Result::REJECTED); return; } @@ -99,19 +100,19 @@ void SetDisplayLayoutRequest::Run() { msg_params[strings::night_color_scheme] != app->night_color_scheme()) { // Color scheme param exists and has been previously set, // hence do not allow color change - LOG4CXX_DEBUG(logger_, "Reject Night Color Scheme Change"); + SDL_LOG_DEBUG("Reject Night Color Scheme Change"); SendResponse(false, mobile_apis::Result::REJECTED); return; } } if (msg_params.keyExists(strings::day_color_scheme)) { - LOG4CXX_DEBUG(logger_, "Allow Day Color Scheme Change"); + SDL_LOG_DEBUG("Allow Day Color Scheme Change"); app->set_day_color_scheme(msg_params[strings::day_color_scheme]); } if (msg_params.keyExists(strings::night_color_scheme)) { - LOG4CXX_DEBUG(logger_, "Allow Night Color Scheme Change"); + SDL_LOG_DEBUG("Allow Night Color Scheme Change"); app->set_night_color_scheme(msg_params[strings::night_color_scheme]); } @@ -123,12 +124,12 @@ void SetDisplayLayoutRequest::Run() { } void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) { - 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; } @@ -136,7 +137,7 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) { const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { case hmi_apis::FunctionID::UI_SetDisplayLayout: { - LOG4CXX_INFO(logger_, "Received UI_SetDisplayLayout event"); + SDL_LOG_INFO("Received UI_SetDisplayLayout event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( @@ -182,7 +183,7 @@ void SetDisplayLayoutRequest::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/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc index 0999b596b5..8a5367ecd4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SetDisplayLayoutResponse::SetDisplayLayoutResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ SetDisplayLayoutResponse::SetDisplayLayoutResponse( SetDisplayLayoutResponse::~SetDisplayLayoutResponse() {} void SetDisplayLayoutResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc index a567d1b32f..9ed43b105b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc @@ -46,6 +46,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + namespace { bool IsResultCodeWarning(const app_mngr::commands::ResponseInfo& first, const app_mngr::commands::ResponseInfo& second, @@ -88,16 +90,15 @@ SetGlobalPropertiesRequest::SetGlobalPropertiesRequest( SetGlobalPropertiesRequest::~SetGlobalPropertiesRequest() {} void SetGlobalPropertiesRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR( - logger_, - "No application associated with connection key " << connection_key()); + SDL_LOG_ERROR("No application associated with connection key " + << connection_key()); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -115,8 +116,8 @@ void SetGlobalPropertiesRequest::Run() { verification_result = MessageHelper::VerifyImage( msg_params[strings::menu_icon], app, application_manager_); if (mobile_apis::Result::INVALID_DATA == verification_result) { - LOG4CXX_ERROR( - logger_, "MessageHelper::VerifyImage return " << verification_result); + SDL_LOG_ERROR("MessageHelper::VerifyImage return " + << verification_result); SendResponse(false, verification_result); return; } @@ -126,7 +127,7 @@ void SetGlobalPropertiesRequest::Run() { if (mobile_apis::Result::INVALID_DATA == MessageHelper::VerifyImageVrHelpItems( msg_params[strings::vr_help], app, application_manager_)) { - LOG4CXX_ERROR(logger_, "MessageHelper::VerifyImage return INVALID_DATA!"); + SDL_LOG_ERROR("MessageHelper::VerifyImage return INVALID_DATA!"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -137,7 +138,7 @@ void SetGlobalPropertiesRequest::Run() { strings::auto_complete_list) && msg_params[strings::keyboard_properties].keyExists( strings::auto_complete_text)) { - LOG4CXX_ERROR(logger_, "Replacing deprecated autoCompleteText property"); + SDL_LOG_ERROR("Replacing deprecated autoCompleteText property"); msg_params[strings::keyboard_properties][strings::auto_complete_list][0] = msg_params[strings::keyboard_properties][strings::auto_complete_text] .asString(); @@ -146,7 +147,7 @@ void SetGlobalPropertiesRequest::Run() { } if (IsWhiteSpaceExist()) { - LOG4CXX_ERROR(logger_, "White spaces found"); + SDL_LOG_ERROR("White spaces found"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -162,8 +163,7 @@ void SetGlobalPropertiesRequest::Run() { // check VR params if (is_vr_help_title_present ^ is_vr_help_present) { - LOG4CXX_ERROR(logger_, - "Reject because of vr_help or vr_help_title only provided"); + SDL_LOG_ERROR("Reject because of vr_help or vr_help_title only provided"); SendResponse(false, mobile_apis::Result::REJECTED); return; } @@ -187,12 +187,11 @@ void SetGlobalPropertiesRequest::Run() { is_tts_send_ = true; } if (is_vr_help_title_present && is_vr_help_present) { - LOG4CXX_DEBUG(logger_, "VRHelp params presents"); + SDL_LOG_DEBUG("VRHelp params presents"); if (!CheckVrHelpItemsOrder(msg_params[strings::vr_help])) { - LOG4CXX_ERROR(logger_, - "VR Help Items contains nonsequential positions" - << " (e.g. [1,2,4]) or not started from 1"); + SDL_LOG_ERROR("VR Help Items contains nonsequential positions" + << " (e.g. [1,2,4]) or not started from 1"); SendResponse(false, mobile_apis::Result::REJECTED); return; } @@ -206,14 +205,14 @@ void SetGlobalPropertiesRequest::Run() { auto& help_prompt_manager = app->help_prompt_manager(); help_prompt_manager.OnSetGlobalPropertiesReceived(params, false); } else { - LOG4CXX_DEBUG(logger_, "VRHelp params does not present"); + SDL_LOG_DEBUG("VRHelp params does not present"); DCHECK_OR_RETURN_VOID(!is_vr_help_title_present && !is_vr_help_present); PrepareUIRequestMenuAndKeyboardData(app, msg_params, params); // Preparing data if (params.empty()) { - LOG4CXX_DEBUG(logger_, "No UI info provided"); + SDL_LOG_DEBUG("No UI info provided"); } else { params[strings::app_id] = app->app_id(); SendUIRequest(params, true); @@ -229,7 +228,7 @@ void SetGlobalPropertiesRequest::Run() { false, mobile_apis::Result::INVALID_DATA, "UserLocation is empty"); return; } - LOG4CXX_DEBUG(logger_, "Userlocation params presents"); + SDL_LOG_DEBUG("Userlocation params presents"); const auto& user_location = msg_params[strings::user_location]; app->set_user_location(user_location); @@ -250,7 +249,7 @@ void SetGlobalPropertiesRequest::Run() { // check TTS params if (is_help_prompt_present || is_timeout_prompt_present) { - LOG4CXX_DEBUG(logger_, "TTS params presents"); + SDL_LOG_DEBUG("TTS params presents"); auto tts_params = smart_objects::SmartObject(smart_objects::SmartType_Map); std::vector<std::string> invalid_params; @@ -261,9 +260,8 @@ void SetGlobalPropertiesRequest::Run() { MessageHelper::VerifyTtsFiles(help_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR( - logger_, - "MessageHelper::VerifyTtsFiles return " << verification_result); + SDL_LOG_ERROR("MessageHelper::VerifyTtsFiles return " + << verification_result); invalid_params.push_back("help_prompt"); } else { app->set_help_prompt(help_prompt); @@ -278,9 +276,8 @@ void SetGlobalPropertiesRequest::Run() { timeout_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR( - logger_, - "MessageHelper::VerifyTtsFiles return " << verification_result); + SDL_LOG_ERROR("MessageHelper::VerifyTtsFiles return " + << verification_result); invalid_params.push_back("timeout_prompt"); } else { app->set_timeout_prompt(timeout_prompt); @@ -319,7 +316,7 @@ void SetGlobalPropertiesRequest::Run() { bool SetGlobalPropertiesRequest::CheckVrHelpItemsOrder( const smart_objects::SmartObject& vr_help) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); DCHECK_OR_RETURN(vr_help.getType() == smart_objects::SmartType_Array, false); const size_t vr_help_length = vr_help.length(); DCHECK_OR_RETURN(vr_help_length > 0, false); @@ -329,9 +326,8 @@ bool SetGlobalPropertiesRequest::CheckVrHelpItemsOrder( vr_help.getElement(j).getElement(strings::position).asUInt(); // Elements shall start from 1 and increment one by one if (position != (j + 1)) { - LOG4CXX_ERROR(logger_, - "VR help items order is wrong" - << " at " << j << ", position value:" << position); + SDL_LOG_ERROR("VR help items order is wrong" + << " at " << j << ", position value:" << position); return false; } } @@ -339,7 +335,7 @@ bool SetGlobalPropertiesRequest::CheckVrHelpItemsOrder( } void SetGlobalPropertiesRequest::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(); @@ -348,7 +344,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_SetGlobalProperties: { - LOG4CXX_DEBUG(logger_, "Received UI_SetGlobalProperties event"); + SDL_LOG_DEBUG("Received UI_SetGlobalProperties event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); is_ui_received_ = true; ui_result_ = static_cast<hmi_apis::Common_Result::eType>( @@ -361,7 +357,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::TTS_SetGlobalProperties: { - LOG4CXX_DEBUG(logger_, "Received TTS_SetGlobalProperties event"); + SDL_LOG_DEBUG("Received TTS_SetGlobalProperties event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); is_tts_received_ = true; tts_result_ = static_cast<hmi_apis::Common_Result::eType>( @@ -374,7 +370,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::RC_SetGlobalProperties: { - LOG4CXX_DEBUG(logger_, "Received RC_SetGlobalProperties event"); + SDL_LOG_DEBUG("Received RC_SetGlobalProperties event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_RC); is_rc_received_ = true; rc_result_ = static_cast<hmi_apis::Common_Result::eType>( @@ -383,13 +379,13 @@ void SetGlobalPropertiesRequest::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; } } if (IsPendingResponseExist()) { - LOG4CXX_DEBUG(logger_, "Continue waiting for response"); + SDL_LOG_DEBUG("Continue waiting for response"); return; } mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM; @@ -420,7 +416,7 @@ bool SetGlobalPropertiesRequest::Init() { bool SetGlobalPropertiesRequest::PrepareResponseParameters( mobile_apis::Result::eType& result_code, std::string& info) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace helpers; app_mngr::commands::ResponseInfo ui_properties_info( @@ -475,7 +471,7 @@ bool SetGlobalPropertiesRequest::PrepareResultForMobileResponse( const app_mngr::commands::ResponseInfo& first, const app_mngr::commands::ResponseInfo& second, const app_mngr::commands::ResponseInfo& third) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); app_mngr::commands::ResponseInfo both_info; std::vector<hmi_apis::Common_Result::eType> success_result_codes{ @@ -508,7 +504,7 @@ SetGlobalPropertiesRequest::PrepareResultCodeForResponse( const app_mngr::commands::ResponseInfo& first, const app_mngr::commands::ResponseInfo& second, const app_mngr::commands::ResponseInfo& third) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM; if (IsResultCodeUnsupported(first, second, third) || IsResultCodeUnsupported(second, third, first) || @@ -599,7 +595,7 @@ void SetGlobalPropertiesRequest::PrepareUIRequestVRHelpData( const ApplicationSharedPtr app, const smart_objects::SmartObject& msg_params, smart_objects::SmartObject& out_params) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); DCHECK_OR_RETURN_VOID(app); app->set_vr_help_title(msg_params.getElement(strings::vr_help_title)); @@ -613,7 +609,7 @@ void SetGlobalPropertiesRequest::PrepareUIRequestMenuAndKeyboardData( const ApplicationSharedPtr app, const smart_objects::SmartObject& msg_params, smart_objects::SmartObject& out_params) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); DCHECK_OR_RETURN_VOID(app); const bool is_menu_title_present = @@ -641,7 +637,7 @@ void SetGlobalPropertiesRequest::PrepareUIRequestMenuAndKeyboardData( void SetGlobalPropertiesRequest::SendTTSRequest( const smart_objects::SmartObject& params, bool use_events) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); is_tts_send_ = true; StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); SendHMIRequest( @@ -650,7 +646,7 @@ void SetGlobalPropertiesRequest::SendTTSRequest( void SetGlobalPropertiesRequest::SendUIRequest( const smart_objects::SmartObject& params, bool use_events) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); is_ui_send_ = true; StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest( @@ -660,7 +656,7 @@ void SetGlobalPropertiesRequest::SendUIRequest( void SetGlobalPropertiesRequest::SendRCRequest( const ns_smart_device_link::ns_smart_objects::SmartObject& params, bool use_events) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); is_rc_send_ = true; StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_RC); SendHMIRequest( @@ -674,7 +670,7 @@ bool SetGlobalPropertiesRequest::IsPendingResponseExist() { bool SetGlobalPropertiesRequest::ValidateConditionalMandatoryParameters( const smart_objects::SmartObject& params) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); return params.keyExists(strings::help_prompt) || params.keyExists(strings::timeout_prompt) || params.keyExists(strings::vr_help_title) || @@ -687,7 +683,7 @@ bool SetGlobalPropertiesRequest::ValidateConditionalMandatoryParameters( } bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str; const smart_objects::SmartObject& msg_params = @@ -703,7 +699,7 @@ bool SetGlobalPropertiesRequest::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; } } @@ -719,7 +715,7 @@ bool SetGlobalPropertiesRequest::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; } } @@ -735,15 +731,14 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { for (; it_vh != it_vh_end; ++it_vh) { str = (*it_vh)[strings::text].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid vr_help text syntax check failed"); + SDL_LOG_ERROR("Invalid vr_help text 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; } } // if image exists @@ -753,7 +748,7 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { if (msg_params.keyExists(strings::menu_icon)) { str = msg_params[strings::menu_icon][strings::value].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid menu_icon value syntax check failed"); + SDL_LOG_ERROR("Invalid menu_icon value syntax check failed"); return true; } } @@ -761,7 +756,7 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { if (msg_params.keyExists(strings::vr_help_title)) { str = msg_params[strings::vr_help_title].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid vr_help_title value syntax check failed"); + SDL_LOG_ERROR("Invalid vr_help_title value syntax check failed"); return true; } } @@ -769,7 +764,7 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { if (msg_params.keyExists(strings::menu_title)) { str = msg_params[strings::menu_title].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid menu_title value syntax check failed"); + SDL_LOG_ERROR("Invalid menu_title value syntax check failed"); return true; } } @@ -788,9 +783,9 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { for (; it_lcl != it_lcl_end; ++it_lcl) { str = (*it_lcl).asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid keyboard_properties " - "limited_character_list syntax check failed"); + SDL_LOG_ERROR( + "Invalid keyboard_properties " + "limited_character_list syntax check failed"); return true; } } @@ -807,9 +802,9 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { for (; it != acl_array->end(); ++it) { str = it->asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid keyboard_properties " - "auto_complete_list syntax check failed"); + SDL_LOG_ERROR( + "Invalid keyboard_properties " + "auto_complete_list syntax check failed"); return true; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc index 1de2b97d3a..03c649a02d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SetGlobalPropertiesResponse::SetGlobalPropertiesResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ SetGlobalPropertiesResponse::SetGlobalPropertiesResponse( SetGlobalPropertiesResponse::~SetGlobalPropertiesResponse() {} void SetGlobalPropertiesResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc index d610090aa4..b7b8fc27ad 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc @@ -43,6 +43,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SetMediaClockRequest::SetMediaClockRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -58,18 +60,18 @@ SetMediaClockRequest::SetMediaClockRequest( SetMediaClockRequest::~SetMediaClockRequest() {} void SetMediaClockRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); return; } if (!app->is_media_application()) { - LOG4CXX_ERROR(logger_, "Application is not media application"); + SDL_LOG_ERROR("Application is not media application"); SendResponse(false, mobile_apis::Result::REJECTED); return; } @@ -90,7 +92,7 @@ void SetMediaClockRequest::Run() { } void SetMediaClockRequest::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()) { @@ -111,7 +113,7 @@ void SetMediaClockRequest::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; } } @@ -126,7 +128,7 @@ bool SetMediaClockRequest::isDataValid() { if (update_mode == mobile_apis::UpdateMode::COUNTUP || update_mode == mobile_apis::UpdateMode::COUNTDOWN) { if (!msg_params.keyExists(strings::start_time)) { - LOG4CXX_INFO(logger_, "Invalid data"); + SDL_LOG_INFO("Invalid data"); return false; } @@ -151,13 +153,13 @@ bool SetMediaClockRequest::isDataValid() { (update_mode == mobile_apis::UpdateMode::COUNTDOWN)) || ((end_time_in_seconds < start_time_in_seconds) && (update_mode == mobile_apis::UpdateMode::COUNTUP))) { - LOG4CXX_INFO(logger_, "Invalid data"); + SDL_LOG_INFO("Invalid data"); return false; } } } - LOG4CXX_INFO(logger_, "Data is valid"); + SDL_LOG_INFO("Data is valid"); return true; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc index 948ff84156..0208741795 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SetMediaClockTimerResponse::SetMediaClockTimerResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ SetMediaClockTimerResponse::SetMediaClockTimerResponse( SetMediaClockTimerResponse::~SetMediaClockTimerResponse() {} void SetMediaClockTimerResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_request.cc index 36278168dc..c652764f16 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_request.cc @@ -40,6 +40,8 @@ namespace app_mngr = application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ShowAppMenuRequest::ShowAppMenuRequest( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, @@ -56,14 +58,13 @@ ShowAppMenuRequest::~ShowAppMenuRequest() {} void ShowAppMenuRequest::Run() { using namespace app_mngr; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR( - logger_, - "Application with id " << connection_key() << " is not registered."); + SDL_LOG_ERROR("Application with id " << connection_key() + << " is not registered."); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -76,9 +77,8 @@ void ShowAppMenuRequest::Run() { app->system_context(mobile_apis::PredefinedWindows::DEFAULT_WINDOW), mobile_apis::SystemContext::SYSCTXT_MAIN, mobile_apis::SystemContext::SYSCTXT_MENU)) { - LOG4CXX_ERROR( - logger_, - "Application with id " << connection_key() << " is not activated."); + SDL_LOG_ERROR("Application with id " << connection_key() + << " is not activated."); SendResponse(false, mobile_apis::Result::REJECTED); return; } @@ -90,7 +90,7 @@ void ShowAppMenuRequest::Run() { if (received_msg_params.keyExists(strings::menu_id)) { const int32_t menu_id = received_msg_params[strings::menu_id].asInt(); if (!app->FindSubMenu(menu_id)) { - LOG4CXX_ERROR(logger_, "Menu with id " << menu_id << " is not found."); + SDL_LOG_ERROR("Menu with id " << menu_id << " is not found."); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } @@ -103,7 +103,7 @@ void ShowAppMenuRequest::Run() { void ShowAppMenuRequest::on_event(const app_mngr::event_engine::Event& event) { using namespace app_mngr; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { @@ -120,8 +120,7 @@ void ShowAppMenuRequest::on_event(const app_mngr::event_engine::Event& event) { application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, - "Application with id " << connection_key() + SDL_LOG_ERROR("Application with id " << connection_key() << " is not registered."); return; } @@ -133,7 +132,7 @@ void ShowAppMenuRequest::on_event(const app_mngr::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/sdl_rpc_plugin/src/commands/mobile/show_app_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_response.cc index 2b952ea9ac..e93e7b3d4e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_app_menu_response.cc @@ -39,6 +39,8 @@ namespace app_mngr = application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ShowAppMenuResponse::ShowAppMenuResponse( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, @@ -54,7 +56,7 @@ ShowAppMenuResponse::ShowAppMenuResponse( ShowAppMenuResponse::~ShowAppMenuResponse() {} void ShowAppMenuResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc index b439c1cb16..04310bcd58 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc @@ -46,6 +46,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ShowConstantTBTRequest::ShowConstantTBTRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -61,19 +63,19 @@ ShowConstantTBTRequest::ShowConstantTBTRequest( ShowConstantTBTRequest::~ShowConstantTBTRequest() {} void ShowConstantTBTRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application( (*message_)[strings::params][strings::connection_key].asUInt()); if (!app) { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); return; } // SDLAQ-CRS-664, VC3.1 if ((*message_)[strings::msg_params].empty()) { - LOG4CXX_ERROR(logger_, "INVALID_DATA!"); + SDL_LOG_ERROR("INVALID_DATA!"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -83,8 +85,7 @@ void ShowConstantTBTRequest::Run() { msg_params = (*message_)[strings::msg_params]; if (IsWhiteSpaceExist()) { - LOG4CXX_ERROR(logger_, - "Incoming show constant TBT has contains \t\n \\t \\n"); + SDL_LOG_ERROR("Incoming show constant TBT has contains \t\n \\t \\n"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -96,7 +97,7 @@ void ShowConstantTBTRequest::Run() { msg_params, app, policy_handler_, application_manager_); if (mobile_apis::Result::SUCCESS != processing_result) { - LOG4CXX_ERROR(logger_, "INVALID_DATA!"); + SDL_LOG_ERROR("INVALID_DATA!"); SendResponse(false, processing_result); return; } @@ -106,7 +107,7 @@ void ShowConstantTBTRequest::Run() { verification_result = MessageHelper::VerifyImage( msg_params[strings::turn_icon], app, application_manager_); if (mobile_apis::Result::INVALID_DATA == verification_result) { - LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!"); + SDL_LOG_ERROR("VerifyImage INVALID_DATA!"); SendResponse(false, verification_result); return; } @@ -116,7 +117,7 @@ void ShowConstantTBTRequest::Run() { verification_result = MessageHelper::VerifyImage( msg_params[strings::next_turn_icon], app, application_manager_); if (mobile_apis::Result::INVALID_DATA == verification_result) { - LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!"); + SDL_LOG_ERROR("VerifyImage INVALID_DATA!"); SendResponse(false, verification_result); return; } @@ -185,13 +186,13 @@ void ShowConstantTBTRequest::Run() { } void ShowConstantTBTRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace hmi_apis; const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { case hmi_apis::FunctionID::Navigation_ShowConstantTBT: { - LOG4CXX_INFO(logger_, "Received Navigation_ShowConstantTBT event"); + SDL_LOG_INFO("Received Navigation_ShowConstantTBT event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const Common_Result::eType result_code = static_cast<Common_Result::eType>( @@ -207,21 +208,21 @@ void ShowConstantTBTRequest::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; } } } bool ShowConstantTBTRequest::IsWhiteSpaceExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; if ((*message_)[strings::msg_params].keyExists(strings::turn_icon)) { str = (*message_)[strings::msg_params][strings::turn_icon][strings::value] .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid turn_icon value syntax check failed"); + SDL_LOG_ERROR("Invalid turn_icon value syntax check failed"); return true; } } @@ -231,8 +232,7 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { [strings::value] .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid next_turn_icon value syntax check failed"); + SDL_LOG_ERROR("Invalid next_turn_icon value syntax check failed"); return true; } } @@ -241,8 +241,7 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::navigation_text_1] .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid navigation_text_1 value syntax check failed"); + SDL_LOG_ERROR("Invalid navigation_text_1 value syntax check failed"); return true; } } @@ -251,8 +250,7 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::navigation_text_2] .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid navigation_text_2 value syntax check failed"); + SDL_LOG_ERROR("Invalid navigation_text_2 value syntax check failed"); return true; } } @@ -260,7 +258,7 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { if ((*message_)[strings::msg_params].keyExists(strings::eta)) { str = (*message_)[strings::msg_params][strings::eta].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid eta value syntax check failed"); + SDL_LOG_ERROR("Invalid eta value syntax check failed"); return true; } } @@ -269,8 +267,7 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::total_distance].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid total_distance value syntax check failed"); + SDL_LOG_ERROR("Invalid total_distance value syntax check failed"); return true; } } @@ -280,8 +277,7 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { str = (*message_)[strings::msg_params][strings::time_to_destination] .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid time_to_destination value syntax check failed"); + SDL_LOG_ERROR("Invalid time_to_destination value syntax check failed"); return true; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc index d027daf77d..7d546079e8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ShowConstantTBTResponse::ShowConstantTBTResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ ShowConstantTBTResponse::ShowConstantTBTResponse( ShowConstantTBTResponse::~ShowConstantTBTResponse() {} void ShowConstantTBTResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc index 84d11f8e09..910ab9ef23 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc @@ -44,6 +44,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ShowRequest::ShowRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -83,9 +85,8 @@ void ShowRequest::HandleMetadata(const char* field_id, [hmi_request::field_types][i] = current_tag; } } else { - LOG4CXX_INFO(logger_, - "metadata tag provided with no item for " - << field_id << ", ignoring with warning"); + SDL_LOG_INFO("metadata tag provided with no item for " + << field_id << ", ignoring with warning"); // tag provided with no item, ignore with warning if (mobile_apis::Result::INVALID_ENUM == core_result_code_) { core_result_code_ = mobile_apis::Result::WARNINGS; @@ -94,14 +95,13 @@ void ShowRequest::HandleMetadata(const char* field_id, } } } else { - LOG4CXX_INFO(logger_, - "No metadata tagging provided for field: " << field_id); + SDL_LOG_INFO("No metadata tagging provided for field: " << field_id); } } bool ShowRequest::CheckTemplateConfigurationForApp( application_manager::Application& app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if ((*message_)[strings::msg_params].keyExists(strings::window_id)) { current_window_id_ = @@ -112,21 +112,20 @@ bool ShowRequest::CheckTemplateConfigurationForApp( const auto new_template_layout = template_config_[strings::template_layout].asString(); const auto old_template_layout = app.window_layout(current_window_id_); - LOG4CXX_DEBUG(logger_, "New layout: " << new_template_layout); - LOG4CXX_DEBUG(logger_, "Old layout: " << old_template_layout); + SDL_LOG_DEBUG("New layout: " << new_template_layout); + SDL_LOG_DEBUG("Old layout: " << old_template_layout); const bool layouts_equal = (new_template_layout == old_template_layout); if (!new_template_layout.empty() && !layouts_equal) { // Template switched, hence allow any color change - LOG4CXX_DEBUG(logger_, - "Show Request: Setting new Layout: " << new_template_layout + SDL_LOG_DEBUG("Show Request: Setting new Layout: " << new_template_layout << " for window ID: " << current_window_id_); layout_change_required_ = true; return true; } - LOG4CXX_DEBUG(logger_, "Show Request: No Layout Change"); + SDL_LOG_DEBUG("Show Request: No Layout Change"); return false; }; @@ -140,10 +139,10 @@ bool ShowRequest::CheckTemplateConfigurationForApp( app.day_color_scheme(current_window_id_)) { // Color scheme param exists and has been previously set, // hence do not allow color change - LOG4CXX_DEBUG(logger_, "Day Color Scheme change is rejected"); + SDL_LOG_DEBUG("Day Color Scheme change is rejected"); return false; } - LOG4CXX_DEBUG(logger_, "Day Color Scheme change is allowed"); + SDL_LOG_DEBUG("Day Color Scheme change is allowed"); dcs_change_required_ = true; return true; @@ -159,10 +158,10 @@ bool ShowRequest::CheckTemplateConfigurationForApp( app.night_color_scheme(current_window_id_)) { // Color scheme param exists and has been previously set, // hence do not allow color change - LOG4CXX_DEBUG(logger_, "Night Color Scheme change is rejected"); + SDL_LOG_DEBUG("Night Color Scheme change is rejected"); return false; } - LOG4CXX_DEBUG(logger_, "Night Color Scheme Change is allowed"); + SDL_LOG_DEBUG("Night Color Scheme Change is allowed"); ncs_change_required_ = true; return true; @@ -192,7 +191,7 @@ bool ShowRequest::CheckTemplateConfigurationForApp( void ShowRequest::ApplyTemplateConfigurationForApp( mobile_apis::Result::eType result, application_manager::Application& app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>( result, mobile_apis::Result::SUCCESS, @@ -200,7 +199,7 @@ void ShowRequest::ApplyTemplateConfigurationForApp( if (layout_change_required_) { const std::string new_layout = template_config_[strings::template_layout].asString(); - LOG4CXX_DEBUG(logger_, "New layout : " << new_layout << " is applied"); + SDL_LOG_DEBUG("New layout : " << new_layout << " is applied"); app.set_window_layout(current_window_id_, new_layout); if (template_config_.keyExists(strings::day_color_scheme)) { @@ -217,13 +216,13 @@ void ShowRequest::ApplyTemplateConfigurationForApp( } if (dcs_change_required_) { - LOG4CXX_DEBUG(logger_, "New day color scheme is applied"); + SDL_LOG_DEBUG("New day color scheme is applied"); app.set_day_color_scheme(current_window_id_, template_config_[strings::day_color_scheme]); } if (ncs_change_required_) { - LOG4CXX_DEBUG(logger_, "New night color scheme is applied"); + SDL_LOG_DEBUG("New night color scheme is applied"); app.set_night_color_scheme(current_window_id_, template_config_[strings::night_color_scheme]); } @@ -231,24 +230,24 @@ void ShowRequest::ApplyTemplateConfigurationForApp( } void ShowRequest::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; } // SDLAQ-CRS-494, VC3.1 if ((*message_)[strings::msg_params].empty()) { - LOG4CXX_ERROR(logger_, strings::msg_params << " is empty."); + SDL_LOG_ERROR(strings::msg_params << " is empty."); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } if (!CheckStringsOfShowRequest()) { - LOG4CXX_ERROR(logger_, "Incorrect characters in string"); + SDL_LOG_ERROR("Incorrect characters in string"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -266,7 +265,7 @@ void ShowRequest::Run() { } if (mobile_apis::Result::SUCCESS != processing_result) { - LOG4CXX_ERROR(logger_, "Processing of soft buttons failed."); + SDL_LOG_ERROR("Processing of soft buttons failed."); SendResponse(false, processing_result); return; } @@ -281,7 +280,7 @@ void ShowRequest::Run() { app, application_manager_); if (mobile_apis::Result::INVALID_DATA == verification_result) { - LOG4CXX_ERROR(logger_, "Image verification failed."); + SDL_LOG_ERROR("Image verification failed."); SendResponse(false, verification_result); return; } @@ -293,7 +292,7 @@ void ShowRequest::Run() { app, application_manager_); if (mobile_apis::Result::INVALID_DATA == verification_result) { - LOG4CXX_ERROR(logger_, "Image verification failed."); + SDL_LOG_ERROR("Image verification failed."); SendResponse(false, verification_result); return; } @@ -421,8 +420,7 @@ void ShowRequest::Run() { const auto window_id = (*message_)[strings::msg_params][strings::window_id].asInt(); if (!app->WindowIdExists(window_id)) { - LOG4CXX_ERROR(logger_, - "Window with id #" << window_id << " does not exist"); + SDL_LOG_ERROR("Window with id #" << window_id << " does not exist"); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } @@ -453,21 +451,21 @@ void ShowRequest::Run() { } void ShowRequest::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(); 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; } switch (event.id()) { case hmi_apis::FunctionID::UI_Show: { - LOG4CXX_DEBUG(logger_, "Received UI_Show event."); + SDL_LOG_DEBUG("Received UI_Show event."); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); std::string response_info; hmi_apis::Common_Result::eType result_code = @@ -498,41 +496,41 @@ void ShowRequest::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; } } } bool ShowRequest::CheckStringsOfShowRequest() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str; if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) { str = (*message_)[strings::msg_params][strings::main_field_4].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid main_field_4 syntax check failed"); + SDL_LOG_ERROR("Invalid main_field_4 syntax check failed"); return false; } } if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) { str = (*message_)[strings::msg_params][strings::main_field_3].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid main_field_3 syntax check failed"); + SDL_LOG_ERROR("Invalid main_field_3 syntax check failed"); return false; } } if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) { str = (*message_)[strings::msg_params][strings::main_field_2].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid main_field_2 syntax check failed"); + SDL_LOG_ERROR("Invalid main_field_2 syntax check failed"); return false; } } if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) { str = (*message_)[strings::msg_params][strings::main_field_1].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid main_field_1 syntax check failed"); + SDL_LOG_ERROR("Invalid main_field_1 syntax check failed"); return false; } } @@ -540,28 +538,28 @@ bool ShowRequest::CheckStringsOfShowRequest() { str = (*message_)[strings::msg_params][strings::template_title].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid templateTitle syntax check failed"); + SDL_LOG_ERROR("Invalid templateTitle syntax check failed"); return false; } } if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) { str = (*message_)[strings::msg_params][strings::status_bar].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid status_bar syntax check failed"); + SDL_LOG_ERROR("Invalid status_bar syntax check failed"); return false; } } if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) { str = (*message_)[strings::msg_params][strings::media_clock].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid media_clock syntax check failed"); + SDL_LOG_ERROR("Invalid media_clock syntax check failed"); return false; } } if ((*message_)[strings::msg_params].keyExists(strings::media_track)) { str = (*message_)[strings::msg_params][strings::media_track].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid media_track syntax check failed"); + SDL_LOG_ERROR("Invalid media_track syntax check failed"); return false; } } @@ -571,7 +569,7 @@ bool ShowRequest::CheckStringsOfShowRequest() { for (size_t i = 0; i < custom_presets_array.length(); ++i) { str = custom_presets_array[i].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid custom_presets syntax check failed"); + SDL_LOG_ERROR("Invalid custom_presets syntax check failed"); return false; } } @@ -581,7 +579,7 @@ bool ShowRequest::CheckStringsOfShowRequest() { str = (*message_)[strings::msg_params][strings::graphic][strings::value] .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid graphic value syntax check failed"); + SDL_LOG_ERROR("Invalid graphic value syntax check failed"); return false; } } @@ -591,8 +589,7 @@ bool ShowRequest::CheckStringsOfShowRequest() { [strings::value] .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, - "Invalid secondary_graphic value syntax check failed"); + SDL_LOG_ERROR("Invalid secondary_graphic value syntax check failed"); return false; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc index f5667189b7..074fcabc7a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + ShowResponse::ShowResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ ShowResponse::ShowResponse( ShowResponse::~ShowResponse() {} void ShowResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc index dd7b426b40..15ced6d5a1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc @@ -43,6 +43,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SliderRequest::SliderRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -72,20 +74,20 @@ bool SliderRequest::Init() { } void SliderRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr application = application_manager_.application( (*message_)[strings::params][strings::connection_key].asUInt()); if (!application) { - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } if ((*message_)[strings::msg_params][strings::num_ticks].asInt() < (*message_)[strings::msg_params][strings::position].asInt()) { - LOG4CXX_ERROR(logger_, "INVALID_DATA"); + SDL_LOG_ERROR("INVALID_DATA"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -94,7 +96,7 @@ void SliderRequest::Run() { if (1 < (*message_)[strings::msg_params][strings::slider_footer].length()) { if ((*message_)[strings::msg_params][strings::num_ticks].asUInt() != (*message_)[strings::msg_params][strings::slider_footer].length()) { - LOG4CXX_ERROR(logger_, "INVALID_DATA"); + SDL_LOG_ERROR("INVALID_DATA"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -102,7 +104,7 @@ void SliderRequest::Run() { } if (IsWhiteSpaceExist()) { - LOG4CXX_ERROR(logger_, "Incoming slider has contains \t\n \\t \\n"); + SDL_LOG_ERROR("Incoming slider has contains \t\n \\t \\n"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -126,7 +128,7 @@ void SliderRequest::Run() { } void SliderRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace helpers; using namespace smart_objects; using namespace hmi_apis; @@ -135,18 +137,18 @@ void SliderRequest::on_event(const event_engine::Event& event) { const event_engine::Event::EventID event_id = event.id(); if (event_id == FunctionID::UI_OnResetTimeout) { - LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event"); + SDL_LOG_INFO("Received UI_OnResetTimeout event"); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); return; } if (event_id != FunctionID::UI_Slider) { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SDL_LOG_ERROR("Received unknown event " << event.id()); return; } - LOG4CXX_DEBUG(logger_, "Received UI_Slider event"); + SDL_LOG_DEBUG("Received UI_Slider event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); const Common_Result::eType response_code = static_cast<Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); @@ -163,8 +165,7 @@ void SliderRequest::on_event(const event_engine::Event& event) { response_msg_params[strings::slider_position] = message[strings::params][strings::data][strings::slider_position]; } else { - LOG4CXX_ERROR(logger_, - strings::slider_position << " field is absent" + SDL_LOG_ERROR(strings::slider_position << " field is absent" " in response."); response_msg_params[strings::slider_position] = 0; } @@ -181,12 +182,12 @@ void SliderRequest::on_event(const event_engine::Event& event) { } bool SliderRequest::IsWhiteSpaceExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; str = (*message_)[strings::msg_params][strings::slider_header].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid slider_header value syntax check failed"); + SDL_LOG_ERROR("Invalid slider_header value syntax check failed"); return true; } @@ -200,7 +201,7 @@ bool SliderRequest::IsWhiteSpaceExist() { for (; it_sf != it_sf_end; ++it_sf) { str = (*it_sf).asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid slider_footer syntax check failed"); + SDL_LOG_ERROR("Invalid slider_footer syntax check failed"); return true; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc index 4ac96a272e..72b0003d8d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SliderResponse::SliderResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ SliderResponse::SliderResponse( SliderResponse::~SliderResponse() {} void SliderResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc index 0730a8730f..b8de053853 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc @@ -43,6 +43,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SpeakRequest::SpeakRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -60,20 +62,20 @@ SpeakRequest::SpeakRequest( SpeakRequest::~SpeakRequest() {} void SpeakRequest::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; } if (IsWhiteSpaceExist()) { - LOG4CXX_ERROR(logger_, - "Incoming speak has contains \\t\\n \\\\t \\\\n " - " text contains only whitespace in ttsChunks"); + SDL_LOG_ERROR( + "Incoming speak has contains \\t\\n \\\\t \\\\n " + " text contains only whitespace in ttsChunks"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -84,9 +86,8 @@ void SpeakRequest::Run() { MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR( - logger_, - "MessageHelper::VerifyTtsFiles return " << verification_result); + SDL_LOG_ERROR("MessageHelper::VerifyTtsFiles return " + << verification_result); SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, "One or more files needed for tts_chunks are not present"); @@ -103,23 +104,23 @@ void SpeakRequest::Run() { } void SpeakRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); switch (event.id()) { case hmi_apis::FunctionID::TTS_Speak: { - LOG4CXX_INFO(logger_, "Received TTS_Speak event"); + SDL_LOG_INFO("Received TTS_Speak event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); ProcessTTSSpeakResponse(event.smart_object()); break; } case hmi_apis::FunctionID::TTS_OnResetTimeout: { - LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event"); + SDL_LOG_INFO("Received TTS_OnResetTimeout event"); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); break; } default: { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SDL_LOG_ERROR("Received unknown event " << event.id()); break; } } @@ -127,14 +128,14 @@ void SpeakRequest::on_event(const event_engine::Event& event) { void SpeakRequest::ProcessTTSSpeakResponse( const smart_objects::SmartObject& message) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace helpers; ApplicationSharedPtr application = application_manager_.application(connection_key()); if (!application) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } @@ -158,7 +159,7 @@ void SpeakRequest::ProcessTTSSpeakResponse( } bool SpeakRequest::IsWhiteSpaceExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) { @@ -171,7 +172,7 @@ bool SpeakRequest::IsWhiteSpaceExist() { for (; it_tc != it_tc_end; ++it_tc) { str = (*it_tc)[strings::text].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed"); + SDL_LOG_ERROR("Invalid tts_chunks syntax check failed"); return true; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc index 69b04977ef..3f9c49ac50 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SpeakResponse::SpeakResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,7 +58,7 @@ SpeakResponse::SpeakResponse( SpeakResponse::~SpeakResponse() {} void SpeakResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc index 3797913f5b..42cb3c60c9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc @@ -41,6 +41,8 @@ namespace commands { namespace str = strings; +SDL_CREATE_LOG_VARIABLE("Commands") + SubscribeButtonRequest::SubscribeButtonRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -56,12 +58,12 @@ SubscribeButtonRequest::SubscribeButtonRequest( SubscribeButtonRequest::~SubscribeButtonRequest() {} void SubscribeButtonRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED"); + SDL_LOG_ERROR("APPLICATION_NOT_REGISTERED"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -71,8 +73,7 @@ void SubscribeButtonRequest::Run() { (*message_)[str::msg_params][str::button_name].asInt()); if (!IsSubscriptionAllowed(app, btn_id)) { - LOG4CXX_ERROR(logger_, - "Subscribe on button " << btn_id << " isn't allowed"); + SDL_LOG_ERROR("Subscribe on button " << btn_id << " isn't allowed"); SendResponse(false, mobile_apis::Result::REJECTED); return; } @@ -83,23 +84,22 @@ void SubscribeButtonRequest::Run() { bool play_pause_supported = CheckHMICapabilities(mobile_apis::ButtonName::PLAY_PAUSE); if (play_pause_supported) { - LOG4CXX_DEBUG(logger_, "Converting Legacy OK button to PLAY_PAUSE"); + SDL_LOG_DEBUG("Converting Legacy OK button to PLAY_PAUSE"); btn_id = mobile_apis::ButtonName::PLAY_PAUSE; (*message_)[str::msg_params][str::button_name] = btn_id; } else if (!ok_supported) { - LOG4CXX_ERROR(logger_, "OK button isn't allowed by HMI capabilities"); + SDL_LOG_ERROR("OK button isn't allowed by HMI capabilities"); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); } } else if (!CheckHMICapabilities(btn_id)) { - LOG4CXX_ERROR(logger_, - "Subscribe on button " - << btn_id << " isn't allowed by HMI capabilities"); + SDL_LOG_ERROR("Subscribe on button " + << btn_id << " isn't allowed by HMI capabilities"); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); return; } if (app->IsSubscribedToButton(btn_id)) { - LOG4CXX_ERROR(logger_, "Already subscribed to button " << btn_id); + SDL_LOG_ERROR("Already subscribed to button " << btn_id); SendResponse(false, mobile_apis::Result::IGNORED); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc index e584f84f4c..216d1e186d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc @@ -38,6 +38,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SubscribeButtonResponse::SubscribeButtonResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -53,12 +55,12 @@ SubscribeButtonResponse::SubscribeButtonResponse( SubscribeButtonResponse::~SubscribeButtonResponse() {} void SubscribeButtonResponse::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; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc index 2ee7771833..6afa462f39 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SubscribeWayPointsRequest::SubscribeWayPointsRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,14 +56,13 @@ SubscribeWayPointsRequest::SubscribeWayPointsRequest( SubscribeWayPointsRequest::~SubscribeWayPointsRequest() {} void SubscribeWayPointsRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, - "An application with connection key " - << connection_key() << " is not registered."); + SDL_LOG_ERROR("An application with connection key " + << connection_key() << " is not registered."); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -83,12 +84,12 @@ void SubscribeWayPointsRequest::Run() { } void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: { - LOG4CXX_INFO(logger_, "Received Navigation_SubscribeWayPoints event"); + SDL_LOG_INFO("Received Navigation_SubscribeWayPoints event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( @@ -107,7 +108,7 @@ void SubscribeWayPointsRequest::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; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc index 45486792d7..ab3fc0a4b8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SubscribeWayPointsResponse::SubscribeWayPointsResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ SubscribeWayPointsResponse::SubscribeWayPointsResponse( SubscribeWayPointsResponse::~SubscribeWayPointsResponse() {} void SubscribeWayPointsResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc index 23604a6b93..502290328a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SubtleAlertRequest::SubtleAlertRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -75,9 +77,9 @@ bool SubtleAlertRequest::Init() { // If soft buttons are present, SDL will not use initiate timeout tracking for // response. if (msg_params.keyExists(strings::soft_buttons)) { - LOG4CXX_INFO(logger_, - "Request contains soft buttons - request timeout " - "will be set to 0."); + SDL_LOG_INFO( + "Request contains soft buttons - request timeout " + "will be set to 0."); default_timeout_ = 0; } @@ -85,7 +87,7 @@ bool SubtleAlertRequest::Init() { } void SubtleAlertRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); uint32_t app_id = (*message_)[strings::params][strings::connection_key].asInt(); @@ -112,24 +114,24 @@ void SubtleAlertRequest::Run() { } void SubtleAlertRequest::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::TTS_OnResetTimeout: case hmi_apis::FunctionID::UI_OnResetTimeout: { - LOG4CXX_INFO(logger_, - "Received UI_OnResetTimeout event " - " or TTS_OnResetTimeout event" - << awaiting_tts_speak_response_ << " " - << awaiting_tts_stop_speaking_response_ << " " - << awaiting_ui_subtle_alert_response_); + SDL_LOG_INFO( + "Received UI_OnResetTimeout event " + " or TTS_OnResetTimeout event" + << awaiting_tts_speak_response_ << " " + << awaiting_tts_stop_speaking_response_ << " " + << awaiting_ui_subtle_alert_response_); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); break; } case hmi_apis::FunctionID::UI_SubtleAlert: { - LOG4CXX_INFO(logger_, "Received UI_SubtleAlert event"); + SDL_LOG_INFO("Received UI_SubtleAlert event"); // Unsubscribe from event to avoid unwanted messages EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); unsubscribe_from_event(hmi_apis::FunctionID::UI_SubtleAlert); @@ -154,7 +156,7 @@ void SubtleAlertRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::TTS_Speak: { - LOG4CXX_INFO(logger_, "Received TTS_Speak event"); + SDL_LOG_INFO("Received TTS_Speak event"); // Unsubscribe from event to avoid unwanted messages EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); unsubscribe_from_event(hmi_apis::FunctionID::TTS_Speak); @@ -165,7 +167,7 @@ void SubtleAlertRequest::on_event(const event_engine::Event& event) { break; } case hmi_apis::FunctionID::TTS_StopSpeaking: { - LOG4CXX_INFO(logger_, "Received TTS_StopSpeaking event"); + SDL_LOG_INFO("Received TTS_StopSpeaking event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS); // Unsubscribe from event to avoid unwanted messages unsubscribe_from_event(hmi_apis::FunctionID::TTS_StopSpeaking); @@ -173,7 +175,7 @@ void SubtleAlertRequest::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; } } @@ -249,11 +251,11 @@ bool SubtleAlertRequest::PrepareResponseParameters( } bool SubtleAlertRequest::Validate(uint32_t app_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(app_id); if (!app) { - LOG4CXX_ERROR(logger_, "No application associated with session key"); + SDL_LOG_ERROR("No application associated with session key"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return false; } @@ -263,7 +265,7 @@ bool SubtleAlertRequest::Validate(uint32_t app_id) { app->AreCommandLimitsExceeded( static_cast<mobile_apis::FunctionID::eType>(function_id()), application_manager::TLimitSource::POLICY_TABLE)) { - LOG4CXX_ERROR(logger_, "SubtleAlert frequency is too high."); + SDL_LOG_ERROR("SubtleAlert frequency is too high."); SendResponse(false, mobile_apis::Result::REJECTED, "SubtleAlert frequency is too high."); @@ -284,7 +286,7 @@ bool SubtleAlertRequest::Validate(uint32_t app_id) { application_manager_); if (mobile_apis::Result::SUCCESS != processing_result) { - LOG4CXX_ERROR(logger_, "INVALID_DATA!"); + SDL_LOG_ERROR("INVALID_DATA!"); SendResponse(false, processing_result); return false; } @@ -293,7 +295,7 @@ bool SubtleAlertRequest::Validate(uint32_t app_id) { if ((!(*message_)[strings::msg_params].keyExists(strings::alert_text1)) && (!(*message_)[strings::msg_params].keyExists(strings::alert_text2)) && (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks))) { - LOG4CXX_ERROR(logger_, "Mandatory parameters are missing"); + SDL_LOG_ERROR("Mandatory parameters are missing"); SendResponse(false, mobile_apis::Result::INVALID_DATA, "Mandatory parameters are missing"); @@ -307,9 +309,8 @@ bool SubtleAlertRequest::Validate(uint32_t app_id) { MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR( - logger_, - "MessageHelper::VerifyTtsFiles return " << verification_result); + SDL_LOG_ERROR("MessageHelper::VerifyTtsFiles return " + << verification_result); SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, "One or more files needed for tts_chunks are not present"); @@ -321,7 +322,7 @@ bool SubtleAlertRequest::Validate(uint32_t app_id) { } void SubtleAlertRequest::SendSubtleAlertRequest(int32_t app_id) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(app_id); smart_objects::SmartObject msg_params = @@ -369,7 +370,7 @@ void SubtleAlertRequest::SendSubtleAlertRequest(int32_t app_id) { application_manager_); if (mobile_apis::Result::INVALID_DATA == verification_result) { - LOG4CXX_ERROR(logger_, "Image verification failed."); + SDL_LOG_ERROR("Image verification failed."); SendResponse(false, verification_result); return; } @@ -400,7 +401,7 @@ void SubtleAlertRequest::SendSubtleAlertRequest(int32_t app_id) { void SubtleAlertRequest::SendSpeakRequest(int32_t app_id, bool tts_chunks_exists, size_t length_tts_chunks) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace hmi_apis; using namespace smart_objects; // crate HMI speak request @@ -418,13 +419,13 @@ void SubtleAlertRequest::SendSpeakRequest(int32_t app_id, } bool SubtleAlertRequest::CheckStrings() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) { str = (*message_)[strings::msg_params][strings::alert_text1].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid alert_text_1 syntax check failed"); + SDL_LOG_ERROR("Invalid alert_text_1 syntax check failed"); return false; } } @@ -432,7 +433,7 @@ bool SubtleAlertRequest::CheckStrings() { if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) { str = (*message_)[strings::msg_params][strings::alert_text2].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid alert_text_2 syntax check failed"); + SDL_LOG_ERROR("Invalid alert_text_2 syntax check failed"); return false; } } @@ -443,7 +444,7 @@ bool SubtleAlertRequest::CheckStrings() { for (size_t i = 0; i < tts_chunks_array.length(); ++i) { str = tts_chunks_array[i][strings::text].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid tts_chunks text syntax check failed"); + SDL_LOG_ERROR("Invalid tts_chunks text syntax check failed"); return false; } } @@ -452,7 +453,7 @@ bool SubtleAlertRequest::CheckStrings() { } bool SubtleAlertRequest::HasHmiResponsesToWait() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); return awaiting_ui_subtle_alert_response_ || awaiting_tts_speak_response_ || awaiting_tts_stop_speaking_response_; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_response.cc index ad9252997b..594a967877 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SubtleAlertResponse::SubtleAlertResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ SubtleAlertResponse::SubtleAlertResponse( SubtleAlertResponse::~SubtleAlertResponse() {} void SubtleAlertResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc index 033e70a29c..17e295304c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc @@ -51,7 +51,7 @@ Copyright (c) 2018, Ford Motor Company namespace sdl_rpc_plugin { using namespace application_manager; -CREATE_LOGGERPTR_LOCAL(logger_, "ApplicationManager") +SDL_CREATE_LOG_VARIABLE("Commands") namespace { #ifdef ENABLE_LOG @@ -80,11 +80,10 @@ class QueryAppsDataValidator { : data_(object), manager_(manager) {} bool Validate() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!data_.isValid()) { - LOG4CXX_ERROR(logger_, - kQueryAppsValidationFailedPrefix - << "QueryApps response is not valid."); + SDL_LOG_ERROR(kQueryAppsValidationFailedPrefix + << "QueryApps response is not valid."); return false; } if (!HasResponseKey()) { @@ -96,10 +95,9 @@ class QueryAppsDataValidator { private: bool HasResponseKey() const { if (!data_.keyExists(json::response)) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "QueryApps response does not contain '" - << json::response << "' parameter."); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "QueryApps response does not contain '" << json::response + << "' parameter."); return false; } return true; @@ -109,9 +107,8 @@ class QueryAppsDataValidator { smart_objects::SmartArray* objects_array = data_[json::response].asArray(); if (!objects_array) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "QueryApps response is not array."); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "QueryApps response is not array."); return false; } @@ -125,16 +122,15 @@ class QueryAppsDataValidator { const smart_objects::SmartObject& app_data = *applications_iterator; if (!app_data.isValid()) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "Wrong application data in json file."); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "Wrong application data in json file."); return false; } if (!CheckMandatoryParametersPresent(app_data)) { - LOG4CXX_WARN(logger_, - "Application hasn`t some of mandatory parameters. " - "Application will be skipped."); + SDL_LOG_WARN( + "Application hasn`t some of mandatory parameters. " + "Application will be skipped."); applications_iterator = objects_array->erase(applications_iterator); continue; @@ -153,12 +149,11 @@ class QueryAppsDataValidator { if (json::ios == os_type) { if (app_data[json::ios][json::urlScheme].asString().length() > kUrlSchemaLengthMax) { - LOG4CXX_WARN( - logger_, + SDL_LOG_WARN( kQueryAppsValidationFailedPrefix - << "An urlscheme length exceeds maximum allowed [" - << app_data[json::ios][json::urlScheme].asString().length() - << "]>[" << kUrlSchemaLengthMax << "]"); + << "An urlscheme length exceeds maximum allowed [" + << app_data[json::ios][json::urlScheme].asString().length() + << "]>[" << kUrlSchemaLengthMax << "]"); return false; } } @@ -166,23 +161,20 @@ class QueryAppsDataValidator { if (json::android == os_type) { if (app_data[json::android][json::packageName].asString().length() > kPackageNameLengthMax) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "Package name length [" - << app_data[json::android][json::packageName] - .asString() - .length() - << "] exceeds max length [" << kPackageNameLengthMax - << "]in json file."); + SDL_LOG_WARN( + kQueryAppsValidationFailedPrefix + << "Package name length [" + << app_data[json::android][json::packageName].asString().length() + << "] exceeds max length [" << kPackageNameLengthMax + << "]in json file."); return false; } } // Languages verification if (!app_data[os_type].keyExists(json::languages)) { - LOG4CXX_WARN( - logger_, - kQueryAppsValidationFailedPrefix << "'languages' doesn't exist"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "'languages' doesn't exist"); return false; } if (!ValidateLanguages(app_data[os_type][json::languages], @@ -199,18 +191,16 @@ class QueryAppsDataValidator { // Verify appid length const std::string app_id(app_data[json::appId].asString()); if (app_id.length() > kAppIdLengthMax) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "An Object ID length exceeds maximum allowed [" - << app_id.length() << "]>[" << kAppIdLengthMax << "]"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "An Object ID length exceeds maximum allowed [" + << app_id.length() << "]>[" << kAppIdLengthMax << "]"); return false; } // Verify that appid is unique if (applications_id_set_.find(app_id) != applications_id_set_.end()) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "An Object ID is not unigue [" << app_id << "]"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "An Object ID is not unigue [" << app_id << "]"); return false; } applications_id_set_.insert(app_id); @@ -219,18 +209,15 @@ class QueryAppsDataValidator { ApplicationSharedPtr registered_app = manager_.application_by_policy_id(app_id); if (registered_app) { - LOG4CXX_INFO( - logger_, - "Application with the id: " << app_id << " is already registered."); + SDL_LOG_INFO("Application with the id: " << app_id + << " is already registered."); } // And app name length const std::string appName(app_data[json::name].asString()); if (appName.length() > kAppNameLengthMax) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "Name of application exceeds maximum allowed [" - << appName.length() << "]>[" << kAppNameLengthMax - << "]."); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "Name of application exceeds maximum allowed [" + << appName.length() << "]>[" << kAppNameLengthMax << "]."); return false; } return true; @@ -241,33 +228,29 @@ class QueryAppsDataValidator { bool default_language_found = false; const size_t languages_array_size = languages.length(); if (languages_array_size > kLanguageArraySizeMax) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "'languages' array exceeds max size [" - << languages_array_size << "]>[" << kLanguageArraySizeMax - << "]"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "'languages' array exceeds max size [" + << languages_array_size << "]>[" << kLanguageArraySizeMax + << "]"); return false; } // Every language has ttsname string and vrsynonyms array for (size_t idx = 0; idx < languages_array_size; ++idx) { const smart_objects::SmartObject& language = languages.getElement(idx); if (smart_objects::SmartType_Map != language.getType()) { - LOG4CXX_WARN( - logger_, - kQueryAppsValidationFailedPrefix << "language is not a map."); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "language is not a map."); return false; } if (language.length() != 1) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "language map size is not equal 1."); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "language map size is not equal 1."); return false; } const std::string language_name = (*language.map_begin()).first; if (!language_name.length()) { - LOG4CXX_WARN( - logger_, - kQueryAppsValidationFailedPrefix << "language name is empty"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "language name is empty"); return false; } // Verify default language defined @@ -280,9 +263,8 @@ class QueryAppsDataValidator { } // ttsName verification if (!language[language_name].keyExists(json::ttsName)) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "'languages.ttsName' doesn't exist"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "'languages.ttsName' doesn't exist"); return false; } const smart_objects::SmartObject& ttsNameObject = @@ -292,17 +274,15 @@ class QueryAppsDataValidator { const std::string ttsName = language[language_name][json::ttsName].asString(); if (ttsName.length() > kTtsNameLengthMax) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "ttsName string exceeds max length [" - << ttsName.length() << "]>[" << kTtsNameLengthMax - << "]"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "ttsName string exceeds max length [" + << ttsName.length() << "]>[" << kTtsNameLengthMax + << "]"); return false; } } else { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "ttsName is not the string type."); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "ttsName is not the string type."); return false; } @@ -311,9 +291,8 @@ class QueryAppsDataValidator { } } if (!default_language_found) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << " 'languages'.default' doesn't exist"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << " 'languages'.default' doesn't exist"); return false; } return true; @@ -323,34 +302,29 @@ class QueryAppsDataValidator { const std::string& language_name, SynonymsMap& synonyms_map) const { if (!language[language_name].keyExists(json::vrSynonyms)) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "'languages.vrSynonyms' doesn't exist"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "'languages.vrSynonyms' doesn't exist"); return false; } const smart_objects::SmartArray* synonyms_array = language[language_name][json::vrSynonyms].asArray(); if (!synonyms_array) { - LOG4CXX_WARN( - logger_, - kQueryAppsValidationFailedPrefix << "vrSynonyms is not array."); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "vrSynonyms is not array."); return false; } const size_t synonyms_array_size = synonyms_array->size(); if (synonyms_array_size < kVrArraySizeMin) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "vrSynomyms array has [" << synonyms_array_size - << "] size < allowed min size [" << kVrArraySizeMin - << "]"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "vrSynomyms array has [" << synonyms_array_size + << "] size < allowed min size [" << kVrArraySizeMin << "]"); return false; } if (synonyms_array_size > kVrArraySizeMax) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "vrSynomyms array size [" << synonyms_array_size - << "] exceeds maximum allowed size [" << kVrArraySizeMax - << "]"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "vrSynomyms array size [" << synonyms_array_size + << "] exceeds maximum allowed size [" << kVrArraySizeMax + << "]"); return false; } @@ -358,19 +332,17 @@ class QueryAppsDataValidator { const smart_objects::SmartObject& synonym = (*synonyms_array)[idx]; const std::string vrSynonym = synonym.asString(); if (vrSynonym.length() > kVrSynonymLengthMax) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "vrSYnomym item [" << idx - << "] exceeds max length [" << vrSynonym.length() - << "]>[" << kVrSynonymLengthMax << "]"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "vrSYnomym item [" << idx << "] exceeds max length [" + << vrSynonym.length() << "]>[" << kVrSynonymLengthMax + << "]"); return false; } if (vrSynonym.length() < kVrSynonymLengthMin) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "vrSYnomym item [" << idx << "] length [" - << vrSynonym.length() << "] is less then min length [" - << kVrSynonymLengthMin << "] allowed."); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "vrSYnomym item [" << idx << "] length [" + << vrSynonym.length() << "] is less then min length [" + << kVrSynonymLengthMin << "] allowed."); return false; } // Verify duplicates @@ -378,11 +350,10 @@ class QueryAppsDataValidator { synonyms_map.find(language_name); if (synonyms_map_iter != synonyms_map.end()) { if (!(*synonyms_map_iter).second.insert(vrSynonym).second) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "vrSYnomym item already defined [" - << vrSynonym.c_str() << "] for language [" - << language_name << "]"); + SDL_LOG_WARN(kQueryAppsValidationFailedPrefix + << "vrSYnomym item already defined [" + << vrSynonym.c_str() << "] for language [" + << language_name << "]"); return false; } } @@ -449,13 +420,13 @@ SystemRequest::SystemRequest( SystemRequest::~SystemRequest() {} void SystemRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr application = application_manager_.application(connection_key()); if (application.use_count() == 0) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -473,14 +444,12 @@ void SystemRequest::Run() { if (!policy_handler.IsRequestTypeAllowed( application->device(), application->policy_app_id(), request_type)) { - LOG4CXX_ERROR(logger_, - "RequestType " << stringified_request_type + SDL_LOG_ERROR("RequestType " << stringified_request_type << " is DISALLOWED by policies"); SendResponse(false, mobile_apis::Result::DISALLOWED); return; } - LOG4CXX_TRACE(logger_, - "RequestType " << stringified_request_type << " is ALLOWED"); + SDL_LOG_TRACE("RequestType " << stringified_request_type << " is ALLOWED"); const bool request_subtype_present = (*message_)[strings::msg_params].keyExists(strings::request_subtype); @@ -489,14 +458,12 @@ void SystemRequest::Run() { (*message_)[strings::msg_params][strings::request_subtype].asString(); if (!policy_handler.IsRequestSubTypeAllowed(application->policy_app_id(), request_subtype)) { - LOG4CXX_ERROR(logger_, - "Request subtype: " << request_subtype + SDL_LOG_ERROR("Request subtype: " << request_subtype << " is DISALLOWED by policies"); SendResponse(false, mobile_apis::Result::DISALLOWED); return; } - LOG4CXX_TRACE(logger_, - "Request subtype: " << request_subtype << " is ALLOWED"); + SDL_LOG_TRACE("Request subtype: " << request_subtype << " is ALLOWED"); } std::string file_name = kSYNC; @@ -507,8 +474,7 @@ void SystemRequest::Run() { } if (!CheckSyntax(file_name)) { - LOG4CXX_ERROR(logger_, - "Incoming request contains \t\n \\t \\n or whitespace"); + SDL_LOG_ERROR("Incoming request contains \t\n \\t \\n or whitespace"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -516,7 +482,7 @@ void SystemRequest::Run() { if (!file_system::IsFileNameValid(file_name) && mobile_apis::RequestType::ICON_URL != request_type) { const std::string err_msg = "Sync file name contains forbidden symbols."; - LOG4CXX_ERROR(logger_, err_msg); + SDL_LOG_ERROR(err_msg); SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str()); return; } @@ -547,7 +513,7 @@ void SystemRequest::Run() { SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str()); return; } - LOG4CXX_DEBUG(logger_, "Got ICON_URL Request. File name: " << file_name); + SDL_LOG_DEBUG("Got ICON_URL Request. File name: " << file_name); } else { binary_data_folder = application_manager_.get_settings().system_files_path(); @@ -566,13 +532,12 @@ void SystemRequest::Run() { file_dst_path += file_name; if ((*message_)[strings::params].keyExists(strings::binary_data)) { - LOG4CXX_DEBUG( - logger_, + SDL_LOG_DEBUG( "Binary data is present. Trying to save it to: " << binary_data_folder); if (mobile_apis::Result::SUCCESS != (application_manager_.SaveBinary( binary_data, binary_data_folder, file_name, 0))) { - LOG4CXX_DEBUG(logger_, "Binary data can't be saved."); + SDL_LOG_DEBUG("Binary data can't be saved."); SendResponse(false, mobile_apis::Result::GENERIC_ERROR); return; } @@ -580,23 +545,22 @@ void SystemRequest::Run() { std::string app_full_file_path = binary_data_folder; app_full_file_path += file_name; - LOG4CXX_DEBUG(logger_, - "Binary data is not present. Trying to find file " - << file_name << " within previously saved app file in " - << binary_data_folder); + SDL_LOG_DEBUG("Binary data is not present. Trying to find file " + << file_name << " within previously saved app file in " + << binary_data_folder); const application_manager::AppFile* file = application->GetFile(app_full_file_path); if (!file || !file->is_download_complete || !file_system::MoveFile(app_full_file_path, file_dst_path)) { - LOG4CXX_DEBUG(logger_, "Binary data not found."); + SDL_LOG_DEBUG("Binary data not found."); SendResponse(false, mobile_apis::Result::REJECTED); return; } processing_file_ = file_dst_path; } - LOG4CXX_DEBUG(logger_, "Binary data ok."); + SDL_LOG_DEBUG("Binary data ok."); if (mobile_apis::RequestType::ICON_URL == request_type) { application_manager_.SetIconFileFromSystemRequest(file_name); @@ -620,7 +584,7 @@ void SystemRequest::Run() { Json::Value root; if (!reader.parse(json, &root)) { - LOG4CXX_DEBUG(logger_, "Unable to parse query_app json file. "); + SDL_LOG_DEBUG("Unable to parse query_app json file. "); return; } @@ -662,7 +626,7 @@ void SystemRequest::Run() { } void SystemRequest::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(); @@ -683,7 +647,7 @@ void SystemRequest::on_event(const event_engine::Event& event) { application_manager_.application(connection_key()); if (application.use_count() == 0) { - LOG4CXX_ERROR(logger_, "NULL pointer"); + SDL_LOG_ERROR("NULL pointer"); return; } @@ -696,7 +660,7 @@ void SystemRequest::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; } } @@ -705,16 +669,14 @@ void SystemRequest::on_event(const event_engine::Event& event) { bool SystemRequest::ValidateQueryAppData( smart_objects::SmartObject& data) const { if (!data.isValid()) { - LOG4CXX_ERROR( - logger_, - kQueryAppsValidationFailedPrefix << "QueryApps response is not valid."); + SDL_LOG_ERROR(kQueryAppsValidationFailedPrefix + << "QueryApps response is not valid."); return false; } if (!data.keyExists(json::response)) { - LOG4CXX_ERROR(logger_, - kQueryAppsValidationFailedPrefix - << "QueryApps response does not contain '" - << json::response << "' parameter."); + SDL_LOG_ERROR(kQueryAppsValidationFailedPrefix + << "QueryApps response does not contain '" << json::response + << "' parameter."); return false; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc index 428901a1c5..00b0cd3b5e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + SystemResponse::SystemResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ SystemResponse::SystemResponse( SystemResponse::~SystemResponse() {} void SystemResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc index 3ba0513aeb..10f808b771 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc @@ -40,12 +40,14 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + void UnregisterAppInterfaceRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); if (!application_manager_.application(connection_key())) { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc index 7c90639968..28d05bef73 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc @@ -38,8 +38,10 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + void UnregisterAppInterfaceResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); SendResponse((*message_)[strings::msg_params][strings::success].asBool()); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc index ec8de68c9e..69f85568eb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc @@ -41,6 +41,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + namespace str = strings; UnsubscribeButtonRequest::UnsubscribeButtonRequest( @@ -58,12 +60,12 @@ UnsubscribeButtonRequest::UnsubscribeButtonRequest( UnsubscribeButtonRequest::~UnsubscribeButtonRequest() {} void UnsubscribeButtonRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED"); + SDL_LOG_ERROR("APPLICATION_NOT_REGISTERED"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -78,23 +80,22 @@ void UnsubscribeButtonRequest::Run() { bool play_pause_supported = CheckHMICapabilities(mobile_apis::ButtonName::PLAY_PAUSE); if (play_pause_supported) { - LOG4CXX_DEBUG(logger_, "Converting Legacy OK button to PLAY_PAUSE"); + SDL_LOG_DEBUG("Converting Legacy OK button to PLAY_PAUSE"); btn_id = mobile_apis::ButtonName::PLAY_PAUSE; (*message_)[str::msg_params][str::button_name] = btn_id; } else if (!ok_supported) { - LOG4CXX_ERROR(logger_, "OK button isn't allowed by HMI capabilities"); + SDL_LOG_ERROR("OK button isn't allowed by HMI capabilities"); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); } } else if (!CheckHMICapabilities(btn_id)) { - LOG4CXX_ERROR(logger_, - "Button " << btn_id << " isn't allowed by HMI capabilities"); + SDL_LOG_ERROR("Button " << btn_id << " isn't allowed by HMI capabilities"); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); return; } if (!app->UnsubscribeFromButton( static_cast<mobile_apis::ButtonName::eType>(btn_id))) { - LOG4CXX_ERROR(logger_, "App doesn't subscribe to button " << btn_id); + SDL_LOG_ERROR("App doesn't subscribe to button " << btn_id); SendResponse(false, mobile_apis::Result::IGNORED); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc index c69d49bca1..8321840899 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UnsubscribeButtonResponse::UnsubscribeButtonResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,12 +56,12 @@ UnsubscribeButtonResponse::UnsubscribeButtonResponse( UnsubscribeButtonResponse::~UnsubscribeButtonResponse() {} void UnsubscribeButtonResponse::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; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc index 17326a99a0..b15bbc5c56 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UnsubscribeWayPointsRequest::UnsubscribeWayPointsRequest( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,14 +56,13 @@ UnsubscribeWayPointsRequest::UnsubscribeWayPointsRequest( UnsubscribeWayPointsRequest::~UnsubscribeWayPointsRequest() {} void UnsubscribeWayPointsRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, - "An application with connection key " - << connection_key() << " is not registered."); + SDL_LOG_ERROR("An application with connection key " + << connection_key() << " is not registered."); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -88,12 +89,12 @@ void UnsubscribeWayPointsRequest::Run() { } void UnsubscribeWayPointsRequest::on_event(const event_engine::Event& event) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application(connection_key()); const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: { - LOG4CXX_INFO(logger_, "Received Navigation_UnsubscribeWayPoints event"); + SDL_LOG_INFO("Received Navigation_UnsubscribeWayPoints event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( @@ -112,7 +113,7 @@ void UnsubscribeWayPointsRequest::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; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc index a7a180fb46..beb7ef695d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc @@ -39,6 +39,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UnsubscribeWayPointsResponse::UnsubscribeWayPointsResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -54,7 +56,7 @@ UnsubscribeWayPointsResponse::UnsubscribeWayPointsResponse( UnsubscribeWayPointsResponse::~UnsubscribeWayPointsResponse() {} void UnsubscribeWayPointsResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc index 8c2cce9765..824d1150b3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc @@ -46,6 +46,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + namespace custom_str = utils::custom_string; UpdateTurnListRequest::UpdateTurnListRequest( @@ -63,20 +65,19 @@ UpdateTurnListRequest::UpdateTurnListRequest( UpdateTurnListRequest::~UpdateTurnListRequest() {} void UpdateTurnListRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); ApplicationSharedPtr app = application_manager_.application( (*message_)[strings::params][strings::connection_key].asUInt()); if (!app) { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); - LOG4CXX_ERROR(logger_, "Application is not registered"); + SDL_LOG_ERROR("Application is not registered"); return; } if (IsWhiteSpaceExist()) { - LOG4CXX_ERROR(logger_, - "Incoming update turn list has contains \t\n \\t \\n"); + SDL_LOG_ERROR("Incoming update turn list has contains \t\n \\t \\n"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -90,7 +91,7 @@ void UpdateTurnListRequest::Run() { application_manager_); if (mobile_apis::Result::SUCCESS != processing_result) { - LOG4CXX_ERROR(logger_, "INVALID_DATA!"); + SDL_LOG_ERROR("INVALID_DATA!"); SendResponse(false, processing_result); return; } @@ -104,8 +105,7 @@ void UpdateTurnListRequest::Run() { MessageHelper::VerifyImage(turn_list_array[i][strings::turn_icon], app, application_manager_))) { - LOG4CXX_ERROR(logger_, - "MessageHelper::VerifyImage return INVALID_DATA"); + SDL_LOG_ERROR("MessageHelper::VerifyImage return INVALID_DATA"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -118,7 +118,7 @@ void UpdateTurnListRequest::Run() { if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) { if (!CheckTurnListArray()) { - LOG4CXX_ERROR(logger_, "INVALID_DATA!"); + SDL_LOG_ERROR("INVALID_DATA!"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -152,18 +152,18 @@ void UpdateTurnListRequest::Run() { hmi_apis::FunctionID::Navigation_UpdateTurnList, &msg_params, true); } else { // conditional mandatory - LOG4CXX_ERROR(logger_, "INVALID_DATA!"); + SDL_LOG_ERROR("INVALID_DATA!"); SendResponse(false, mobile_apis::Result::INVALID_DATA); } } void UpdateTurnListRequest::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::Navigation_UpdateTurnList: { - LOG4CXX_INFO(logger_, "Received Navigation_UpdateTurnList event"); + SDL_LOG_INFO("Received Navigation_UpdateTurnList event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); const hmi_apis::Common_Result::eType result_code = static_cast<hmi_apis::Common_Result::eType>( @@ -179,7 +179,7 @@ void UpdateTurnListRequest::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; } } @@ -204,7 +204,7 @@ bool UpdateTurnListRequest::CheckTurnListArray() { } bool UpdateTurnListRequest::IsWhiteSpaceExist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* str = NULL; if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) { @@ -218,8 +218,7 @@ bool UpdateTurnListRequest::IsWhiteSpaceExist() { if ((*it_tl).keyExists(strings::navigation_text)) { str = (*it_tl)[strings::navigation_text].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR( - logger_, + SDL_LOG_ERROR( "Invalid turn_list navigation_text text syntax check failed"); return true; } @@ -228,8 +227,8 @@ bool UpdateTurnListRequest::IsWhiteSpaceExist() { if ((*it_tl).keyExists(strings::turn_icon)) { str = (*it_tl)[strings::turn_icon][strings::value].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR( - logger_, "Invalid turn_list turn_icon value syntax check failed"); + SDL_LOG_ERROR( + "Invalid turn_list turn_icon value syntax check failed"); return true; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc index eca9e3703c..bedf91b45c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc @@ -40,6 +40,8 @@ using namespace application_manager; namespace commands { +SDL_CREATE_LOG_VARIABLE("Commands") + UpdateTurnListResponse::UpdateTurnListResponse( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -55,7 +57,7 @@ UpdateTurnListResponse::UpdateTurnListResponse( UpdateTurnListResponse::~UpdateTurnListResponse() {} void UpdateTurnListResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); rpc_service_.SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc index 5ffbbd83bb..9fb6d63273 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc @@ -1,7 +1,7 @@ #include "sdl_rpc_plugin/extensions/system_capability_app_extension.h" namespace sdl_rpc_plugin { -CREATE_LOGGERPTR_GLOBAL(logger_, "GetSystemCapabilitiesAppExtension") +SDL_CREATE_LOG_VARIABLE("GetSystemCapabilitiesAppExtension") namespace app_mngr_ = application_manager; const app_mngr_::AppExtensionUID @@ -18,16 +18,14 @@ SystemCapabilityAppExtension::~SystemCapabilityAppExtension() {} bool SystemCapabilityAppExtension::SubscribeTo( const SystemCapabilityType system_capability_type) { - LOG4CXX_INFO(logger_, - "Subscribing to System Capability " << system_capability_type); + SDL_LOG_INFO("Subscribing to System Capability " << system_capability_type); return subscribed_data_.insert(system_capability_type).second; } bool SystemCapabilityAppExtension::UnsubscribeFrom( const SystemCapabilityType system_capability_type) { - LOG4CXX_INFO( - logger_, - "Unsubscribing from System Capability " << system_capability_type); + SDL_LOG_INFO("Unsubscribing from System Capability " + << system_capability_type); auto it = subscribed_data_.find(system_capability_type); if (it != subscribed_data_.end()) { subscribed_data_.erase(it); @@ -37,13 +35,13 @@ bool SystemCapabilityAppExtension::UnsubscribeFrom( } void SystemCapabilityAppExtension::UnsubscribeFromAll() { - LOG4CXX_INFO(logger_, "Unsubscribing from ALL System Capabilities"); + SDL_LOG_INFO("Unsubscribing from ALL System Capabilities"); subscribed_data_.clear(); } bool SystemCapabilityAppExtension::IsSubscribedTo( const SystemCapabilityType system_capability_type) const { - LOG4CXX_DEBUG(logger_, system_capability_type); + SDL_LOG_DEBUG(system_capability_type); return subscribed_data_.find(system_capability_type) != subscribed_data_.end(); } @@ -54,7 +52,7 @@ SystemCapabilitySubscriptions SystemCapabilityAppExtension::Subscriptions() { void SystemCapabilityAppExtension::SaveResumptionData( ns_smart_device_link::ns_smart_objects::SmartObject& resumption_data) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* application_system_capability = "systemCapability"; resumption_data[application_system_capability] = @@ -69,7 +67,7 @@ void SystemCapabilityAppExtension::SaveResumptionData( void SystemCapabilityAppExtension::ProcessResumption( const smart_objects::SmartObject& resumption_data) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const char* application_system_capability = "systemCapability"; if (resumption_data.keyExists(application_system_capability)) { @@ -85,7 +83,7 @@ void SystemCapabilityAppExtension::ProcessResumption( SystemCapabilityAppExtension& SystemCapabilityAppExtension::ExtractExtension( app_mngr_::Application& app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto ext_ptr = app.QueryInterface( SystemCapabilityAppExtension::SystemCapabilityAppExtensionUID); DCHECK(ext_ptr); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc index a22fad1d3b..570a4ce12e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc @@ -270,7 +270,7 @@ namespace sdl_rpc_plugin { using namespace application_manager; -CREATE_LOGGERPTR_GLOBAL(logger_, "HMICommandFactory") +SDL_CREATE_LOG_VARIABLE("HMICommandFactory") HMICommandFactory::HMICommandFactory( ApplicationManager& application_manager, @@ -288,20 +288,20 @@ CommandSharedPtr HMICommandFactory::CreateCommand( const hmi_apis::FunctionID::eType function_id = static_cast<hmi_apis::FunctionID::eType>( (*message)[strings::params][strings::function_id].asInt()); - LOG4CXX_DEBUG( - logger_, "HMICommandFactory::CreateCommand function_id: " << function_id); + SDL_LOG_DEBUG( + "HMICommandFactory::CreateCommand function_id: " << function_id); const hmi_apis::messageType::eType message_type = static_cast<hmi_apis::messageType::eType>( (*message)[strings::params][strings::message_type].asInt()); if (hmi_apis::messageType::response == message_type) { - LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand response"); + SDL_LOG_DEBUG("HMICommandFactory::CreateCommand response"); } else if ((*message)[strings::params][strings::message_type] == hmi_apis::messageType::error_response) { - LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand error response"); + SDL_LOG_DEBUG("HMICommandFactory::CreateCommand error response"); } else { - LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand request"); + SDL_LOG_DEBUG("HMICommandFactory::CreateCommand request"); } return get_creator_factory(function_id, message_type, source).create(message); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc index a585f4cecf..d2f1325c82 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc @@ -149,7 +149,7 @@ #include "sdl_rpc_plugin/commands/mobile/update_turn_list_request.h" #include "sdl_rpc_plugin/commands/mobile/update_turn_list_response.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") +SDL_CREATE_LOG_VARIABLE("ApplicationManager") namespace sdl_rpc_plugin { using namespace application_manager; @@ -560,8 +560,7 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( static_cast<mobile_apis::FunctionID::eType>( (*message)[strings::params][strings::function_id].asInt()); - LOG4CXX_DEBUG( - logger_, + SDL_LOG_DEBUG( "MobileCommandFactory::CreateCommand function_id: " << function_id); return get_creator_factory(function_id, message_type, source).create(message); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc index 2a1261f643..17fbfe9598 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc @@ -39,7 +39,7 @@ namespace sdl_rpc_plugin { namespace app_mngr = application_manager; namespace plugins = application_manager::plugin_manager; -CREATE_LOGGERPTR_GLOBAL(logger_, "SdlRPCPlugin") +SDL_CREATE_LOG_VARIABLE("SdlRPCPlugin") bool SDLRPCPlugin::Init(app_mngr::ApplicationManager& app_manager, app_mngr::rpc_service::RPCService& rpc_service, @@ -90,7 +90,7 @@ void SDLRPCPlugin::OnApplicationEvent( // Processing automatic subscription to SystemCapabilities for DISPLAY type const auto capability_type = mobile_apis::SystemCapabilityType::eType::DISPLAYS; - LOG4CXX_DEBUG(logger_, "Subscription to DISPLAYS capability is enabled"); + SDL_LOG_DEBUG("Subscription to DISPLAYS capability is enabled"); sys_cap_ext_ptr->SubscribeTo(capability_type); } else if (plugins::ApplicationEvent::kDeleteApplicationData == event) { ClearSubscriptions(application); @@ -106,12 +106,12 @@ void SDLRPCPlugin::ClearSubscriptions(app_mngr::ApplicationSharedPtr app) { extern "C" __attribute__((visibility("default"))) application_manager::plugin_manager::RPCPlugin* -Create() { +Create(logger::Logger* logger_instance) { + logger::Logger::instance(logger_instance); return new sdl_rpc_plugin::SDLRPCPlugin(); } extern "C" __attribute__((visibility("default"))) void Delete( application_manager::plugin_manager::RPCPlugin* data) { delete data; - DELETE_THREAD_LOGGER(sdl_rpc_plugin::logger_); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h index 80336b6967..6e804d470e 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h @@ -90,6 +90,7 @@ class VehicleInfoPlugin : public plugins::RPCPlugin { }; } // namespace vehicle_info_plugin -extern "C" application_manager::plugin_manager::RPCPlugin* Create(); +extern "C" application_manager::plugin_manager::RPCPlugin* Create( + logger::Logger* logger_instances); extern "C" void Delete(application_manager::plugin_manager::RPCPlugin* data); #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_PLUGIN_H 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; } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/custom_vehicle_data_manager_impl.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/custom_vehicle_data_manager_impl.cc index 9df6d922aa..b85fd5aaaf 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/custom_vehicle_data_manager_impl.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/custom_vehicle_data_manager_impl.cc @@ -45,7 +45,7 @@ #include "utils/helpers.h" #include "utils/optional.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin") +SDL_CREATE_LOG_VARIABLE("VehicleInfoPlugin") namespace vehicle_info_plugin { @@ -64,7 +64,7 @@ CustomVehicleDataManagerImpl::CustomVehicleDataManagerImpl( std::string CustomVehicleDataManagerImpl::GetVehicleDataItemType( const std::string& vehicle_data_item_name) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto& schema = FindSchemaByNameNonRecursive(vehicle_data_item_name); return schema.is_initialized() ? std::string(schema->type) @@ -86,7 +86,7 @@ bool CustomVehicleDataManagerImpl::IsRemovedCustomVehicleDataName( void CustomVehicleDataManagerImpl::CreateMobileMessageParams( smart_objects::SmartObject& msg_params) { using namespace application_manager; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); typedef std::function<smart_objects::SmartObject( const smart_objects::SmartObject& input_params, @@ -105,7 +105,7 @@ void CustomVehicleDataManagerImpl::CreateMobileMessageParams( ? FindSchemaByKeyRecursive(key) : FindSchemaByKeyNonRecursive(key); if (!schema.is_initialized()) { - LOG4CXX_DEBUG(logger_, "Schema for: " << key << " cannot be found"); + SDL_LOG_DEBUG("Schema for: " << key << " cannot be found"); continue; } @@ -208,7 +208,7 @@ const OptionalDataItem FindSchema( const std::vector<policy_table::VehicleDataItem>& oem_items, SearchMethod search_method, Comparer comparer) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); std::vector<policy_table::VehicleDataItem> items; for (const auto& item : oem_items) { @@ -495,7 +495,7 @@ void CustomVehicleDataManagerImpl::UpdateVehicleDataItems() { void CustomVehicleDataManagerImpl::OnPolicyEvent( plugin_manager::PolicyEvent policy_event) { using namespace plugin_manager; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); switch (policy_event) { case kApplicationPolicyUpdated: @@ -510,7 +510,7 @@ void CustomVehicleDataManagerImpl::OnPolicyEvent( const OptionalDataItem CustomVehicleDataManagerImpl::FindSchemaByNameNonRecursive( const std::string& name) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto& oem_items = vehicle_data_provider_.GetVehicleDataItems(); auto compare_by_name = [&name](const policy_table::VehicleDataItem& item) { @@ -523,7 +523,7 @@ CustomVehicleDataManagerImpl::FindSchemaByNameNonRecursive( const OptionalDataItem CustomVehicleDataManagerImpl::FindRemovedSchemaByNameNonRecursive( const std::string& name) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const auto& removed_oem_items = vehicle_data_provider_.GetRemovedVehicleDataItems(); @@ -537,7 +537,7 @@ CustomVehicleDataManagerImpl::FindRemovedSchemaByNameNonRecursive( const OptionalDataItem CustomVehicleDataManagerImpl::FindSchemaByNameRecursive( const std::string& name) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto& oem_items = vehicle_data_provider_.GetVehicleDataItems(); auto compare_by_name = [&name](const policy_table::VehicleDataItem& item) { @@ -550,7 +550,7 @@ const OptionalDataItem CustomVehicleDataManagerImpl::FindSchemaByNameRecursive( const OptionalDataItem CustomVehicleDataManagerImpl::FindSchemaByKeyNonRecursive( const std::string& key) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto& oem_items = vehicle_data_provider_.GetVehicleDataItems(); auto compare_by_key = [&key](const policy_table::VehicleDataItem& item) { @@ -562,7 +562,7 @@ CustomVehicleDataManagerImpl::FindSchemaByKeyNonRecursive( const OptionalDataItem CustomVehicleDataManagerImpl::FindSchemaByKeyRecursive( const std::string& key) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); auto& oem_items = vehicle_data_provider_.GetVehicleDataItems(); auto compare_by_key = [&key](const policy_table::VehicleDataItem& item) { diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_data_item_schema.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_data_item_schema.cc index 750da9fa6e..b4ae7aca45 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_data_item_schema.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_data_item_schema.cc @@ -4,7 +4,7 @@ namespace vehicle_info_plugin { #ifdef ENABLE_LOG -CREATE_LOGGERPTR_LOCAL(vehicle_data_logger, "VehicleDataItemSchema"); +SDL_CREATE_LOG_VARIABLE("VehicleDataItemSchema"); #endif // ENABLE_LOG VehicleDataItemSchema::VehicleDataItemSchema(PolicyDataItem& policy_item, @@ -153,7 +153,7 @@ smart_objects::ISchemaItemPtr VehicleDataItemSchema::GetPODTypeSchema( std::string error_msg = std::string("Invalid POD type provided: ") + std::string(policy_item.type); - LOG4CXX_ERROR(vehicle_data_logger, error_msg.c_str()); + SDL_LOG_ERROR(error_msg.c_str()); return nullptr; } @@ -168,7 +168,7 @@ smart_objects::ISchemaItemPtr VehicleDataItemSchema::getEnumSchema( const std::string& type_name) const { auto enum_schema = policy_table::EnumSchemaItemFactory::Get(type_name); if (!enum_schema) { - LOG4CXX_ERROR(vehicle_data_logger, "NULL pointer: " << type_name); + SDL_LOG_ERROR("NULL pointer: " << type_name); } return enum_schema; } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc index 149299d3bb..952f980984 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc @@ -33,7 +33,7 @@ #include "vehicle_info_plugin/vehicle_info_app_extension.h" #include "vehicle_info_plugin/vehicle_info_plugin.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin") +SDL_CREATE_LOG_VARIABLE("VehicleInfoPlugin") namespace vehicle_info_plugin { @@ -45,22 +45,22 @@ VehicleInfoAppExtension::VehicleInfoAppExtension( VehicleInfoAppExtension::VehicleInfoAppExtensionUID) , plugin_(plugin) , app_(app) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } VehicleInfoAppExtension::~VehicleInfoAppExtension() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } bool VehicleInfoAppExtension::subscribeToVehicleInfo( const std::string& vehicle_data) { - LOG4CXX_DEBUG(logger_, vehicle_data); + SDL_LOG_DEBUG(vehicle_data); return subscribed_data_.insert(vehicle_data).second; } bool VehicleInfoAppExtension::unsubscribeFromVehicleInfo( const std::string& vehicle_data) { - LOG4CXX_DEBUG(logger_, vehicle_data); + SDL_LOG_DEBUG(vehicle_data); auto it = subscribed_data_.find(vehicle_data); if (it != subscribed_data_.end()) { subscribed_data_.erase(it); @@ -70,13 +70,13 @@ bool VehicleInfoAppExtension::unsubscribeFromVehicleInfo( } void VehicleInfoAppExtension::unsubscribeFromVehicleInfo() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); subscribed_data_.clear(); } bool VehicleInfoAppExtension::isSubscribedToVehicleInfo( const std::string& vehicle_data) const { - LOG4CXX_DEBUG(logger_, vehicle_data); + SDL_LOG_DEBUG(vehicle_data); return subscribed_data_.find(vehicle_data) != subscribed_data_.end(); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc index 52ee9f476d..5bebdf8e2a 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc @@ -32,7 +32,7 @@ #include "vehicle_info_plugin/vehicle_info_command_factory.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin") +SDL_CREATE_LOG_VARIABLE("VehicleInfoPlugin") namespace vehicle_info_plugin { @@ -57,7 +57,7 @@ VehicleInfoCommandFactory::VehicleInfoCommandFactory( hmi_capabilities, policy_handler, custom_vehicle_data_manager)) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } VehicleInfoCommandFactory::~VehicleInfoCommandFactory() {} diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc index e8d852b612..3687245066 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc @@ -52,7 +52,7 @@ #include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h" #include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin") +SDL_CREATE_LOG_VARIABLE("VehicleInfoPlugin") namespace vehicle_info_plugin { namespace strings = app_mngr::strings; @@ -108,7 +108,7 @@ struct VehicleInfoCommandCreatorFactory { template <typename VehicleInfoCommandType> application_manager::CommandCreator& GetCreator() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); static VehicleInfoCommandCreator<VehicleInfoCommandType> res(params_); return res; } @@ -126,7 +126,7 @@ VehicleInfoHmiCommandFactory::VehicleInfoHmiCommandFactory( , hmi_capabilities_(hmi_capabilities) , policy_handler_(policy_handler) , custom_vehicle_data_manager_(custom_vehicle_data_manager) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } app_mngr::CommandSharedPtr VehicleInfoHmiCommandFactory::CreateCommand( @@ -150,9 +150,8 @@ app_mngr::CommandSharedPtr VehicleInfoHmiCommandFactory::CreateCommand( } UNUSED(message_type_str); - LOG4CXX_DEBUG(logger_, - "HMICommandFactory::CreateCommand function_id: " - << function_id << ", message type: " << message_type_str); + SDL_LOG_DEBUG("HMICommandFactory::CreateCommand function_id: " + << function_id << ", message type: " << message_type_str); return buildCommandCreator(function_id, message_type).create(message); } @@ -212,7 +211,7 @@ app_mngr::CommandCreator& VehicleInfoHmiCommandFactory::buildCommandCreator( ? factory.GetCreator<commands::VIDiagnosticMessageRequest>() : factory.GetCreator<commands::VIDiagnosticMessageResponse>(); default: - LOG4CXX_WARN(logger_, "Unsupported function_id: " << function_id); + SDL_LOG_WARN("Unsupported function_id: " << function_id); return factory.GetCreator<VehicleInfoInvalidCommand>(); } } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc index c3c8d9c8d7..b2d7df5d28 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc @@ -52,7 +52,7 @@ #include "vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h" #include "vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h" -CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin") +SDL_CREATE_LOG_VARIABLE("VehicleInfoPlugin") namespace vehicle_info_plugin { namespace strings = app_mngr::strings; @@ -108,7 +108,7 @@ struct VehicleInfoCommandCreatorFactory { template <typename VehicleInfoCommandType> application_manager::CommandCreator& GetCreator() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); static VehicleInfoCommandCreator<VehicleInfoCommandType> res(params_); return res; } @@ -126,7 +126,7 @@ VehicleInfoMobileCommandFactory::VehicleInfoMobileCommandFactory( , hmi_capabilities_(hmi_capabilities) , policy_handler_(policy_handler) , custom_vehicle_data_manager_(custom_vehicle_data_manager) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); } app_mngr::CommandSharedPtr VehicleInfoMobileCommandFactory::CreateCommand( @@ -150,9 +150,8 @@ app_mngr::CommandSharedPtr VehicleInfoMobileCommandFactory::CreateCommand( } UNUSED(message_type_str); - LOG4CXX_DEBUG(logger_, - "HMICommandFactory::CreateCommand function_id: " - << function_id << ", message type: " << message_type_str); + SDL_LOG_DEBUG("HMICommandFactory::CreateCommand function_id: " + << function_id << ", message type: " << message_type_str); return get_creator_factory(function_id, message_type, source).create(message); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc index 1c553fb84d..18c9b6413e 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc @@ -40,7 +40,7 @@ #include "vehicle_info_plugin/vehicle_info_command_factory.h" namespace vehicle_info_plugin { -CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin") +SDL_CREATE_LOG_VARIABLE("VehicleInfoPlugin") namespace strings = application_manager::strings; namespace plugins = application_manager::plugin_manager; @@ -117,7 +117,7 @@ void VehicleInfoPlugin::OnApplicationEvent( } void VehicleInfoPlugin::UnsubscribeFromRemovedVDItems() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); typedef std::vector<std::string> StringsVector; auto get_items_to_unsubscribe = [this]() -> StringsVector { @@ -131,10 +131,9 @@ void VehicleInfoPlugin::UnsubscribeFromRemovedVDItems() { subscription_name)) { ext.unsubscribeFromVehicleInfo(subscription_name); if (!helpers::in_range(output_items_list, subscription_name)) { - LOG4CXX_DEBUG(logger_, - "Vehicle data item " - << subscription_name - << " has been removed by policy"); + SDL_LOG_DEBUG("Vehicle data item " + << subscription_name + << " has been removed by policy"); output_items_list.push_back(subscription_name); } } @@ -146,7 +145,7 @@ void VehicleInfoPlugin::UnsubscribeFromRemovedVDItems() { const StringsVector items_to_unsubscribe = get_items_to_unsubscribe(); if (items_to_unsubscribe.empty()) { - LOG4CXX_DEBUG(logger_, "There is no data to unsubscribe"); + SDL_LOG_DEBUG("There is no data to unsubscribe"); return; } @@ -172,14 +171,14 @@ bool IsOtherAppAlreadySubscribedFor( void VehicleInfoPlugin::ProcessResumptionSubscription( application_manager::Application& app, VehicleInfoAppExtension& ext) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); const auto& subscriptions = ext.Subscriptions(); if (subscriptions.empty()) { - LOG4CXX_DEBUG(logger_, "No vehicle data to subscribe. Exiting"); + SDL_LOG_DEBUG("No vehicle data to subscribe. Exiting"); return; } @@ -216,7 +215,7 @@ application_manager::ApplicationSharedPtr FindAppSubscribedToIVI( smart_objects::SmartObjectSPtr VehicleInfoPlugin::GetUnsubscribeIVIRequest( const std::vector<std::string>& ivi_names) { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); using namespace smart_objects; auto msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); @@ -284,12 +283,12 @@ void VehicleInfoPlugin::DeleteSubscriptions( extern "C" __attribute__((visibility("default"))) application_manager::plugin_manager::RPCPlugin* -Create() { +Create(logger::Logger* logger_instance) { + logger::Logger::instance(logger_instance); return new vehicle_info_plugin::VehicleInfoPlugin(); } extern "C" __attribute__((visibility("default"))) void Delete( application_manager::plugin_manager::RPCPlugin* data) { delete data; - DELETE_THREAD_LOGGER(vehicle_info_plugin::logger_); } |