Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug: Restore sai log levels from LOGLEVEL_DB after saiDiscover #491

Merged
merged 1 commit into from
Jul 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions syncd/syncd.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ sai_status_t processBulkEvent(
_In_ sai_common_api_t api,
_In_ const swss::KeyOpFieldsValuesTuple &kco);

void set_sai_api_loglevel();

void set_sai_api_log_min_prio(
_In_ const std::string &prio);

Expand Down
4 changes: 3 additions & 1 deletion syncd/syncd_saiswitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,11 +967,13 @@ void SaiSwitch::helperDiscover()
{
SWSS_LOG_TIMER("discover");

// Change sai log level before discovery to prevent SAI ERR spam to the log
set_sai_api_log_min_prio("SAI_LOG_LEVEL_CRITICAL");

saiDiscover(m_switch_rid, m_discovered_rids);

set_sai_api_log_min_prio("SAI_LOG_LEVEL_NOTICE");
// Restore sai log levels from LOGLEVEL_DB
set_sai_api_loglevel();
}

SWSS_LOG_NOTICE("discovered objects count: %zu", m_discovered_rids.size());
Expand Down