Skip to content

Commit 39fe568

Browse files
stchenglguohan
authored andcommitted
[aclorch]: Revise ACL rule creation/removal logs (sonic-net#1042)
Adding the table name in the log when creating/removing the ACL rules. Signed-off-by: Shu0T1an ChenG <[email protected]>
1 parent c461911 commit 39fe568

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

orchagent/aclorch.cpp

+14-7
Original file line numberDiff line numberDiff line change
@@ -1498,19 +1498,22 @@ bool AclTable::add(shared_ptr<AclRule> newRule)
14981498
if (ruleIter->second->remove())
14991499
{
15001500
rules.erase(ruleIter);
1501-
SWSS_LOG_NOTICE("Successfully deleted ACL rule: %s", rule_id.c_str());
1501+
SWSS_LOG_NOTICE("Successfully deleted ACL rule %s in table %s",
1502+
rule_id.c_str(), id.c_str());
15021503
}
15031504
}
15041505

15051506
if (newRule->create())
15061507
{
15071508
rules[rule_id] = newRule;
1508-
SWSS_LOG_NOTICE("Successfully created ACL rule %s in table %s", rule_id.c_str(), id.c_str());
1509+
SWSS_LOG_NOTICE("Successfully created ACL rule %s in table %s",
1510+
rule_id.c_str(), id.c_str());
15091511
return true;
15101512
}
15111513
else
15121514
{
1513-
SWSS_LOG_ERROR("Failed to create rule in table %s", id.c_str());
1515+
SWSS_LOG_ERROR("Failed to create ACL rule %s in table %s",
1516+
rule_id.c_str(), id.c_str());
15141517
return false;
15151518
}
15161519
}
@@ -1525,18 +1528,21 @@ bool AclTable::remove(string rule_id)
15251528
if (ruleIter->second->remove())
15261529
{
15271530
rules.erase(ruleIter);
1528-
SWSS_LOG_NOTICE("Successfully deleted ACL rule %s", rule_id.c_str());
1531+
SWSS_LOG_NOTICE("Successfully deleted ACL rule %s in table %s",
1532+
rule_id.c_str(), id.c_str());
15291533
return true;
15301534
}
15311535
else
15321536
{
1533-
SWSS_LOG_ERROR("Failed to delete ACL rule: %s", rule_id.c_str());
1537+
SWSS_LOG_ERROR("Failed to delete ACL rule %s in table %s",
1538+
rule_id.c_str(), id.c_str());
15341539
return false;
15351540
}
15361541
}
15371542
else
15381543
{
1539-
SWSS_LOG_WARN("Skip deleting ACL rule. Unknown rule %s", rule_id.c_str());
1544+
SWSS_LOG_WARN("Skip deleting unknown ACL rule %s in table %s",
1545+
rule_id.c_str(), id.c_str());
15401546
return true;
15411547
}
15421548
}
@@ -1551,7 +1557,8 @@ bool AclTable::clear()
15511557
bool suc = rule.remove();
15521558
if (!suc)
15531559
{
1554-
SWSS_LOG_ERROR("Failed to delete existing ACL rule %s when removing the ACL table %s", rule.getId().c_str(), id.c_str());
1560+
SWSS_LOG_ERROR("Failed to delete ACL rule %s when removing the ACL table %s",
1561+
rule.getId().c_str(), id.c_str());
15551562
return false;
15561563
}
15571564
}

0 commit comments

Comments
 (0)