From 39fe568f24eb74fb10b1232899eec2b123eacff3 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Fri, 30 Aug 2019 16:27:37 -0700 Subject: [PATCH] [aclorch]: Revise ACL rule creation/removal logs (#1042) Adding the table name in the log when creating/removing the ACL rules. Signed-off-by: Shu0T1an ChenG --- orchagent/aclorch.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/orchagent/aclorch.cpp b/orchagent/aclorch.cpp index 780b38f84c2c..2e93566dac80 100644 --- a/orchagent/aclorch.cpp +++ b/orchagent/aclorch.cpp @@ -1498,19 +1498,22 @@ bool AclTable::add(shared_ptr newRule) if (ruleIter->second->remove()) { rules.erase(ruleIter); - SWSS_LOG_NOTICE("Successfully deleted ACL rule: %s", rule_id.c_str()); + SWSS_LOG_NOTICE("Successfully deleted ACL rule %s in table %s", + rule_id.c_str(), id.c_str()); } } if (newRule->create()) { rules[rule_id] = newRule; - SWSS_LOG_NOTICE("Successfully created ACL rule %s in table %s", rule_id.c_str(), id.c_str()); + SWSS_LOG_NOTICE("Successfully created ACL rule %s in table %s", + rule_id.c_str(), id.c_str()); return true; } else { - SWSS_LOG_ERROR("Failed to create rule in table %s", id.c_str()); + SWSS_LOG_ERROR("Failed to create ACL rule %s in table %s", + rule_id.c_str(), id.c_str()); return false; } } @@ -1525,18 +1528,21 @@ bool AclTable::remove(string rule_id) if (ruleIter->second->remove()) { rules.erase(ruleIter); - SWSS_LOG_NOTICE("Successfully deleted ACL rule %s", rule_id.c_str()); + SWSS_LOG_NOTICE("Successfully deleted ACL rule %s in table %s", + rule_id.c_str(), id.c_str()); return true; } else { - SWSS_LOG_ERROR("Failed to delete ACL rule: %s", rule_id.c_str()); + SWSS_LOG_ERROR("Failed to delete ACL rule %s in table %s", + rule_id.c_str(), id.c_str()); return false; } } else { - SWSS_LOG_WARN("Skip deleting ACL rule. Unknown rule %s", rule_id.c_str()); + SWSS_LOG_WARN("Skip deleting unknown ACL rule %s in table %s", + rule_id.c_str(), id.c_str()); return true; } } @@ -1551,7 +1557,8 @@ bool AclTable::clear() bool suc = rule.remove(); if (!suc) { - SWSS_LOG_ERROR("Failed to delete existing ACL rule %s when removing the ACL table %s", rule.getId().c_str(), id.c_str()); + SWSS_LOG_ERROR("Failed to delete ACL rule %s when removing the ACL table %s", + rule.getId().c_str(), id.c_str()); return false; } }