From 062d3b0f2a6eb2185d14dc80a885cdfe4860ce23 Mon Sep 17 00:00:00 2001 From: VladSemenyuk Date: Tue, 1 Sep 2020 20:35:06 +0300 Subject: [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 * 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 --- .../src/commands/hmi/update_device_list_request.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc') 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; }; } -- cgit v1.2.1