Skip to content

Commit

Permalink
Standardize log messages across platform code
Browse files Browse the repository at this point in the history
  • Loading branch information
brosahay committed Aug 11, 2024
1 parent da1d447 commit 3dd6aa3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ int32_t wfx_rsi_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_
*****************************************************************************************/
int32_t wfx_wifi_rsi_init(void)
{
ChipLogDetail(DeviceLayer, "wfx_wifi_rsi_init started");
ChipLogDetail(DeviceLayer, "wfx_wifi_rsi_init: started");
sl_status_t status;
status = sl_wifi_init(&config, NULL, sl_wifi_default_event_handler);
VerifyOrReturnError(status == SL_STATUS_OK, status);
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/silabs/efr32/rs911x/rsi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ void wfx_rsi_task(void * arg)
wfx_lwip_start();
wfx_started_notify();

SILABS_LOG("Starting event loop");
SILABS_LOG("wfx_rsi_task: starting event loop");
for (;;)
{
osStatus_t status = osMessageQueueGet(sWifiEventQueue, &wfxEvent, NULL, osWaitForever);
Expand All @@ -823,7 +823,7 @@ void wfx_rsi_task(void * arg)
}
else
{
SILABS_LOG("Failed to get event with status: %x", status);
SILABS_LOG("wfx_rsi_task: get event failed: %x", status);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/silabs/efr32/rs911x/wfx_rsi_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ void wfx_clear_wifi_provision(void)
sl_status_t wfx_connect_to_ap(void)
{
VerifyOrReturnError(wfx_rsi.dev_state & WFX_RSI_ST_STA_PROVISIONED, SL_STATUS_INVALID_CONFIGURATION);
// TODO: check for '\0' in SSID before printing
ChipLogProgress(DeviceLayer, "Connect to access point: %s", wfx_rsi.sec.ssid);
VerifyOrReturnError(strlen(wfx_rsi.sec.ssid) <= WFX_MAX_SSID_LENGTH, SL_STATUS_WOULD_OVERFLOW);
ChipLogProgress(DeviceLayer, "connect to access point: %s", wfx_rsi.sec.ssid);
WfxEvent_t event;
event.eventType = WFX_EVT_STA_START_JOIN;
WfxPostEvent(&event);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ void ConnectivityManagerImpl::DriveStationState()
ChipLogProgress(DeviceLayer, "Attempting to connect WiFi");
if ((serr = wfx_connect_to_ap()) != SL_STATUS_OK)
{
ChipLogError(DeviceLayer, "wfx_connect_to_ap() failed.");
ChipLogError(DeviceLayer, "wfx_connect_to_ap() failed: %" PRId32, serr);
}
SuccessOrExit(serr);

Expand Down
4 changes: 1 addition & 3 deletions src/platform/silabs/SiWx917/wifi/wfx_notify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,10 @@ void wfx_connected_notify(int32_t status, sl_wfx_mac_address_t * ap)

if (status != SUCCESS_STATUS)
{
ChipLogProgress(DeviceLayer, "%s: error: failed status: %ld.", __func__, status);
ChipLogProgress(DeviceLayer, "wfx_connected_notify: error: failed status: %ld", status);
return;
}

ChipLogProgress(DeviceLayer, "%s: connected.", __func__);

memset(&evt, 0, sizeof(evt));
evt.header.id = SL_WFX_CONNECT_IND_ID;
evt.header.length = sizeof evt;
Expand Down
6 changes: 3 additions & 3 deletions src/platform/silabs/efr32/wifi/ethernetif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len)
(memcmp(netif->hwaddr, dst_mac, netif->hwaddr_len) != 0))
{
#ifdef WIFI_DEBUG_ENABLED
ChipLogProgress(DeviceLayer, "%s: DROP, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x",
__func__,
ChipLogProgress(DeviceLayer,
"lwip_input: DROP, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x",

dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5],

Expand All @@ -172,7 +172,7 @@ static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len)
}
#ifdef WIFI_DEBUG_ENABLED
ChipLogProgress(DeviceLayer,
"%s: ACCEPT %ld, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", __func__,
"lwip_input: ACCEPT %ld, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x",
bufferoffset,

dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5],
Expand Down
10 changes: 5 additions & 5 deletions src/platform/silabs/efr32/wifi/wfx_notify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ void wfx_connected_notify(int32_t status, sl_wfx_mac_address_t * ap)

if (status != SUCCESS_STATUS)
{
ChipLogProgress(DeviceLayer, "%s: error: failed status: %ld.", __func__, status);
ChipLogProgress(DeviceLayer, "wfx_connected_notify: error: failed status: %ld", status);
return;
}

ChipLogProgress(DeviceLayer, "%s: connected.", __func__);
ChipLogProgress(DeviceLayer, "wfx_connected_notify: connected");

memset(&evt, 0, sizeof(evt));
evt.header.id = SL_WFX_CONNECT_IND_ID;
Expand Down Expand Up @@ -194,12 +194,12 @@ void wfx_retry_interval_handler(bool is_wifi_disconnection_event, uint16_t retry
*/
if (retryJoin < MAX_JOIN_RETRIES_COUNT)
{
ChipLogProgress(DeviceLayer, "%s: Next attempt after %d Seconds", __func__, CONVERT_MS_TO_SEC(WLAN_RETRY_TIMER_MS));
ChipLogProgress(DeviceLayer, "next retry attempt after %d seconds", CONVERT_MS_TO_SEC(WLAN_RETRY_TIMER_MS));
vTaskDelay(pdMS_TO_TICKS(WLAN_RETRY_TIMER_MS));
}
else
{
ChipLogProgress(DeviceLayer, "Connect failed after max %d tries", retryJoin);
ChipLogProgress(DeviceLayer, "connect failed after max %d tries", retryJoin);
}
}
else
Expand All @@ -213,7 +213,7 @@ void wfx_retry_interval_handler(bool is_wifi_disconnection_event, uint16_t retry
{
retryInterval = WLAN_MAX_RETRY_TIMER_MS;
}
ChipLogProgress(DeviceLayer, "%s: Next attempt after %ld Seconds", __func__, CONVERT_MS_TO_SEC(retryInterval));
ChipLogProgress(DeviceLayer, "next retry attempt after %ld seconds", CONVERT_MS_TO_SEC(retryInterval));
vTaskDelay(pdMS_TO_TICKS(retryInterval));
retryInterval += retryInterval;
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform/silabs/rs911x/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ CHIP_ERROR BLEManagerImpl::_Init()

if (wfx_rsi.ble_task == NULL)
{
ChipLogError(DeviceLayer, "%s: error: failed to create ble task.", __func__);
ChipLogError(DeviceLayer, "error: failed to create BLE task");
}

// Initialize the CHIP BleLayer.
Expand Down

0 comments on commit 3dd6aa3

Please sign in to comment.