From e21215ae0260025b3c420487a61e44755d5ed3cc Mon Sep 17 00:00:00 2001 From: Alex Kutsan Date: Fri, 23 Mar 2018 23:06:30 +0200 Subject: Add apropriate logging in policy flow --- .../application_manager/src/message_helper/message_helper.cc | 1 + src/components/policy/policy_external/src/policy_helper.cc | 6 +++--- src/components/policy/policy_external/src/policy_manager_impl.cc | 5 ++++- src/components/policy/policy_regular/src/policy_helper.cc | 6 +++--- src/components/policy/policy_regular/src/policy_manager_impl.cc | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src') 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 306e9782f5..0270f23144 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -2409,6 +2409,7 @@ void MessageHelper::SendOnPermissionsChangeNotification( uint32_t connection_key, const policy::Permissions& permissions, ApplicationManager& app_mngr) { + LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObject content(smart_objects::SmartType_Map); content[strings::params][strings::function_id] = diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc index 5425777833..8be0372c03 100644 --- a/src/components/policy/policy_external/src/policy_helper.cc +++ b/src/components/policy/policy_external/src/policy_helper.cc @@ -797,7 +797,7 @@ void FillFunctionalGroupPermissions( FunctionalGroupNames& names, GroupConsent state, std::vector& permissions) { - LOG4CXX_INFO(logger_, "FillFunctionalGroupPermissions"); + LOG4CXX_AUTO_TRACE(logger_); FunctionalGroupIDs::const_iterator it = ids.begin(); FunctionalGroupIDs::const_iterator it_end = ids.end(); for (; it != it_end; ++it) { @@ -817,7 +817,7 @@ bool IsPredefinedApp(const AppPoliciesValueType& app) { FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from, const FunctionalGroupIDs& what) { - LOG4CXX_INFO(logger_, "Exclude same groups"); + LOG4CXX_AUTO_TRACE(logger_); FunctionalGroupIDs from_copy(from); FunctionalGroupIDs what_copy(what); @@ -839,7 +839,7 @@ FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from, FunctionalGroupIDs Merge(const FunctionalGroupIDs& first, const FunctionalGroupIDs& second) { - LOG4CXX_INFO(logger_, "Merge groups"); + LOG4CXX_AUTO_TRACE(logger_); FunctionalGroupIDs first_copy(first); FunctionalGroupIDs second_copy(second); diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 806b7e13ba..180b0406a1 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -615,7 +615,8 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, } const bool known_rpc = rpc_permissions.end() != rpc_permissions.find(rpc); - LOG4CXX_INFO(logger_, "Is known rpc " << known_rpc); + LOG4CXX_DEBUG(logger_, "Is known rpc " << + (known_rpc ? "true" : "false") ); if (!known_rpc) { // RPC not found in list == disallowed by backend result.hmi_level_permitted = kRpcDisallowed; @@ -637,6 +638,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, rpc_permissions[rpc].hmi_permissions[kUserDisallowedKey].find( hmi_level)) { // RPC found in allowed == allowed by backend, but disallowed by user + LOG4CXX_DEBUG(logger_, "RPC found in allowed == allowed by backend, but disallowed by user"); result.hmi_level_permitted = kRpcUserDisallowed; } else { LOG4CXX_DEBUG(logger_, @@ -967,6 +969,7 @@ void PolicyManagerImpl::CheckPendingPermissionsChanges( void PolicyManagerImpl::NotifyPermissionsChanges( const std::string& policy_app_id, const std::vector& app_group_permissions) { + LOG4CXX_AUTO_TRACE(logger_); // Get current functional groups from DB with RPC permissions policy_table::FunctionalGroupings functional_groups; cache_->GetFunctionalGroupings(functional_groups); diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc index 782a65f91a..95f275769c 100644 --- a/src/components/policy/policy_regular/src/policy_helper.cc +++ b/src/components/policy/policy_regular/src/policy_helper.cc @@ -709,7 +709,7 @@ void FillFunctionalGroupPermissions( FunctionalGroupNames& names, GroupConsent state, std::vector& permissions) { - LOG4CXX_INFO(logger_, "FillFunctionalGroupPermissions"); + LOG4CXX_AUTO_TRACE(logger_); FunctionalGroupIDs::const_iterator it = ids.begin(); FunctionalGroupIDs::const_iterator it_end = ids.end(); for (; it != it_end; ++it) { @@ -729,7 +729,7 @@ bool IsPredefinedApp(const AppPoliciesValueType& app) { FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from, const FunctionalGroupIDs& what) { - LOG4CXX_INFO(logger_, "Exclude same groups"); + LOG4CXX_AUTO_TRACE(logger_); FunctionalGroupIDs from_copy(from); FunctionalGroupIDs what_copy(what); @@ -751,7 +751,7 @@ FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from, FunctionalGroupIDs Merge(const FunctionalGroupIDs& first, const FunctionalGroupIDs& second) { - LOG4CXX_INFO(logger_, "Merge groups"); + LOG4CXX_AUTO_TRACE(logger_); FunctionalGroupIDs first_copy(first); FunctionalGroupIDs second_copy(second); diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 055b57d985..39b303cbb5 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -754,7 +754,7 @@ void PolicyManagerImpl::GetPermissionsForApp( std::string& PolicyManagerImpl::GetCurrentDeviceId( const std::string& policy_app_id) const { - LOG4CXX_INFO(logger_, "GetDeviceInfo"); + LOG4CXX_AUTO_TRACE(logger_); last_device_id_ = listener()->OnCurrentDeviceIdUpdateRequired(policy_app_id); return last_device_id_; } -- cgit v1.2.1