summaryrefslogtreecommitdiffstats
path: root/aclk
diff options
context:
space:
mode:
authorTimotej S <6674623+underhood@users.noreply.github.com>2021-02-11 13:23:07 +0100
committerGitHub <noreply@github.com>2021-02-11 13:23:07 +0100
commitf1a62106ca0a0dd5c08286edfa7e73dbcc28602b (patch)
treea3e8f83304aef056ed3c141d0db0843b917fe2e0 /aclk
parent877a17b845780957c7e2a6250c389d7911a9bbde (diff)
reduce logging amount in ACLK (#10596)
Diffstat (limited to 'aclk')
-rw-r--r--aclk/legacy/aclk_lws_wss_client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/aclk/legacy/aclk_lws_wss_client.c b/aclk/legacy/aclk_lws_wss_client.c
index 2e6fd4ec87..f06df3f42b 100644
--- a/aclk/legacy/aclk_lws_wss_client.c
+++ b/aclk/legacy/aclk_lws_wss_client.c
@@ -377,7 +377,9 @@ static const char *aclk_lws_callback_name(enum lws_callback_reasons reason)
return "LWS_CALLBACK_EVENT_WAIT_CANCELLED";
default:
// Not using an internal buffer here for thread-safety with unknown calling context.
+#ifdef ACLK_TRP_DEBUG_VERBOSE
error("Unknown LWS callback %u", reason);
+#endif
return "unknown";
}
}
@@ -489,7 +491,9 @@ static int aclk_lws_wss_callback(struct lws *wsi, enum lws_callback_reasons reas
case LWS_CALLBACK_EVENT_WAIT_CANCELLED:
case LWS_CALLBACK_OPENSSL_PERFORM_SERVER_CERT_VERIFICATION:
// Expected and safe to ignore.
+#ifdef ACLK_TRP_DEBUG_VERBOSE
debug(D_ACLK, "Ignoring expected callback from LWS: %s", aclk_lws_callback_name(reason));
+#endif
return retval;
default:
@@ -497,7 +501,9 @@ static int aclk_lws_wss_callback(struct lws *wsi, enum lws_callback_reasons reas
break;
}
// Log to info - volume is proportional to connection attempts.
+#ifdef ACLK_TRP_DEBUG_VERBOSE
info("Processing callback %s", aclk_lws_callback_name(reason));
+#endif
switch (reason) {
case LWS_CALLBACK_PROTOCOL_INIT:
aclk_lws_wss_connect(engine_instance->host, engine_instance->port); // Makes the outgoing connection
@@ -531,7 +537,9 @@ static int aclk_lws_wss_callback(struct lws *wsi, enum lws_callback_reasons reas
break;
default:
+#ifdef ACLK_TRP_DEBUG_VERBOSE
error("Unexpected callback from libwebsockets %s", aclk_lws_callback_name(reason));
+#endif
break;
}
return retval; //0-OK, other connection should be closed!