Skip to content

Commit

Permalink
Adjust log message to address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Sun <stephens@nvidia.com>
  • Loading branch information
stephenxs committed Apr 23, 2024
1 parent 0ab03d8 commit f70164a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions orchagent/notifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ void on_switch_shutdown_request(sai_object_id_t switch_id)

if (gSwitchOrch->isFatalEventReceived())
{
SWSS_LOG_ERROR("Orchagent aborted due to fatal SAI error received");
abort();
}

Expand Down
14 changes: 10 additions & 4 deletions orchagent/switchorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,14 +1119,20 @@ void SwitchOrch::onSwitchAsicSdkHealthEvent(sai_object_id_t switch_id,
{ "category", category_str },
{ "description", description_str }};

if (0 == gMyAsicName.size())
string asic_name_str;
if (!gMyAsicName.empty())
{
SWSS_LOG_NOTICE("[%s] ASIC/SDK health event occurred at %s, category %s: %s", severity_str.c_str(), time_ss.str().c_str(), category_str.c_str(), description_str.c_str());
asic_name_str = "asic " + gMyAsicName + ",";
params["asic_name"] = gMyAsicName;
}

if (severity == SAI_SWITCH_ASIC_SDK_HEALTH_SEVERITY_FATAL)
{
SWSS_LOG_ERROR("[%s] ASIC/SDK health event occurred at %s, %scategory %s: %s", severity_str.c_str(), time_ss.str().c_str(), asic_name_str.c_str(), category_str.c_str(), description_str.c_str());
}
else
{
SWSS_LOG_NOTICE("[%s] ASIC/SDK health event occurred at %s, asic %s, category %s: %s", severity_str.c_str(), time_ss.str().c_str(), gMyAsicName.c_str(), category_str.c_str(), description_str.c_str());
params["asic_name"] = gMyAsicName;
SWSS_LOG_NOTICE("[%s] ASIC/SDK health event occurred at %s, %scategory %s: %s", severity_str.c_str(), time_ss.str().c_str(), asic_name_str.c_str(), category_str.c_str(), description_str.c_str());
}

values.emplace_back("severity", severity_str);
Expand Down

0 comments on commit f70164a

Please sign in to comment.