Skip to content

Commit

Permalink
freertos: disable backend logging on client disconnect
Browse files Browse the repository at this point in the history
This prevents attempts to send logs messages to the cloud when the client
is disconnected. Upon reconnect, backend logging will be enabled based on
CONFIG_GOLIOTH_AUTO_LOG_TO_CLOUD.

Signed-off-by: Mike Szczys <[email protected]>
  • Loading branch information
szczys committed Jul 30, 2024
1 parent b6144c4 commit b2f0e31
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions port/freertos/golioth_sys_freertos.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ void golioth_sys_thread_destroy(golioth_sys_thread_t thread)
* Misc
*------------------------------------------------*/

void golioth_sys_client_connected(void *client) {}
void golioth_sys_client_connected(void *client) {
if (CONFIG_GOLIOTH_AUTO_LOG_TO_CLOUD != 0)
{
golioth_debug_set_cloud_log_enabled(true);
}
}

void golioth_sys_client_disconnected(void *client) {}
void golioth_sys_client_disconnected(void* client) {
golioth_debug_set_cloud_log_enabled(false);
}

0 comments on commit b2f0e31

Please sign in to comment.