diff options
author | Andriy Byzhynar <abyzhynar@luxoft.com> | 2018-09-07 13:39:19 +0300 |
---|---|---|
committer | Andriy Byzhynar <abyzhynar@luxoft.com> | 2018-09-07 14:25:21 +0300 |
commit | 922fd38b6fd9399bb9467d7f5b17dcd03f832afc (patch) | |
tree | 74c2002e1f393a085660f36e8610522b758f8731 | |
parent | 08e2e6ed06bbcd68c4e84f06e2c2f3b414cb8215 (diff) | |
download | sdl_core-922fd38b6fd9399bb9467d7f5b17dcd03f832afc.tar.gz |
Rework usage of PrintSmartObject function
Removed redundant #IFDEFs DEBUG wrappers from calling PrintSmartObject function
as this wrapper moved into function body
4 files changed, 11 insertions, 9 deletions
diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h index 010816808c..609b240301 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -700,6 +700,14 @@ class MessageHelper { ApplicationSharedPtr app, int32_t function_id); + /** + * @brief Prints SmartObject contents to log file + * @param object - SmartObject to print + * @return always True as this function is used for internal debug purposes + * only + * @note Function prints SmartObject only in DEBUG build mode. There will not + * be any print in RELEASE build mode + */ static bool PrintSmartObject(const smart_objects::SmartObject& object); template <typename From, typename To> diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 69040997fe..eaac84dcf2 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1305,9 +1305,7 @@ bool ApplicationManagerImpl::StartNaviService( return false; } else if (!converted_params.empty()) { LOG4CXX_INFO(logger_, "Sending video configuration params"); -#ifdef DEBUG MessageHelper::PrintSmartObject(converted_params); -#endif bool request_sent = application(app_id)->SetVideoConfig(service_type, converted_params); if (request_sent) { diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index eb074327ab..a52cb52fbe 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -2221,11 +2221,7 @@ void MessageHelper::SendSystemRequestNotification( commands::CommandImpl::protocol_version_; content[strings::params][strings::connection_key] = connection_key; - -#ifdef DEBUG PrintSmartObject(content); -#endif - DCHECK(app_mngr.GetRPCService().ManageMobileCommand( std::make_shared<smart_objects::SmartObject>(content), commands::Command::SOURCE_SDL)); @@ -2876,11 +2872,12 @@ void MessageHelper::SubscribeApplicationToSoftButton( } bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) { +#ifdef DEBUG Json::Value tmp; namespace Formatters = ns_smart_device_link::ns_json_handler::formatters; Formatters::CFormatterJsonBase::objToJsonValue(object, tmp); LOG4CXX_DEBUG(logger_, "SMART OBJECT: " << tmp.toStyledString()); - +#endif return true; } diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc index 217af091b5..7a68ae5779 100644 --- a/src/components/application_manager/src/rpc_service_impl.cc +++ b/src/components/application_manager/src/rpc_service_impl.cc @@ -71,9 +71,8 @@ bool RPCServiceImpl::ManageMobileCommand( LOG4CXX_WARN(logger_, "Low Voltage is active"); return false; } -#ifdef DEBUG + MessageHelper::PrintSmartObject(*message); -#endif const uint32_t connection_key = static_cast<uint32_t>( (*message)[strings::params][strings::connection_key].asUInt()); |