Skip to content

Commit

Permalink
reduce loglevel
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor committed Oct 3, 2024
1 parent 70f173b commit ba183a3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
17 changes: 12 additions & 5 deletions src/cloud_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
error_t httpClientTlsInitCallbackBase(HttpClientContext *context,
TlsContext *tlsContext, const char *client_ca, const char *client_crt, const char *client_key)
{
TRACE_INFO("Initializing TLS...\r\n");
TRACE_DEBUG("Initializing TLS...\r\n");
error_t error;

// Select client operation mode
Expand Down Expand Up @@ -67,7 +67,7 @@ error_t httpClientTlsInitCallbackBase(HttpClientContext *context,

tlsContext->serverName = (char *)strdup(context->serverName);

TRACE_INFO("Initializing TLS done\r\n");
TRACE_DEBUG("Initializing TLS done\r\n");

// Successful processing
return NO_ERROR;
Expand Down Expand Up @@ -354,7 +354,14 @@ error_t web_request(const char *server, int port, bool https, const char *uri, c

if (status)
{
TRACE_INFO("HTTP code: %u\r\n", status);
if (status == 200 || status == 302)
{
TRACE_DEBUG("HTTP code: %u\r\n", status);
}
else
{
TRACE_INFO("HTTP code: %u\r\n", status);
}

if (statusCode)
{
Expand Down Expand Up @@ -422,7 +429,7 @@ error_t web_request(const char *server, int port, bool https, const char *uri, c
if (!osStrcmp(header_name, "Content-Type"))
{
osStrncpy(content_type, header_value, sizeof(content_type) - 1);
TRACE_INFO("Content-Type is %s\r\n", content_type);
TRACE_DEBUG("Content-Type is %s\r\n", content_type);
}
} while (1);

Expand Down Expand Up @@ -500,7 +507,7 @@ error_t web_request(const char *server, int port, bool https, const char *uri, c
}

// Debug message
TRACE_INFO("Connection closed\r\n");
TRACE_DEBUG("Connection closed\r\n");
} while (0);

if (success)
Expand Down
6 changes: 3 additions & 3 deletions src/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ void cbrCloudHeaderPassthrough(void *src_ctx, HttpClientContext *cloud_ctx, cons
{
if (osStrcmp(header, "Access-Control-Allow-Origin") != 0)
{
TRACE_INFO(">> cbrCloudHeaderPassthrough: %s = %s\r\n", header, value);
TRACE_DEBUG(">> cbrCloudHeaderPassthrough: %s = %s\r\n", header, value);
osSprintf(line, "%s: %s\r\n", header, value);
}
}
else
{
TRACE_INFO(">> cbrCloudHeaderPassthrough: NULL\r\n");
TRACE_DEBUG(">> cbrCloudHeaderPassthrough: NULL\r\n");
osStrcpy(line, "\r\n");
}

Expand Down Expand Up @@ -403,7 +403,7 @@ void cbrCloudBodyPassthrough(void *src_ctx, HttpClientContext *cloud_ctx, const
void cbrCloudServerDiscoPassthrough(void *src_ctx, HttpClientContext *cloud_ctx)
{
cbr_ctx_t *ctx = (cbr_ctx_t *)src_ctx;
TRACE_INFO(">> cbrCloudServerDiscoPassthrough\r\n");
TRACE_DEBUG(">> cbrCloudServerDiscoPassthrough\r\n");
httpFlushStream(ctx->connection);
ctx->status = PROX_STATUS_DONE;
}
Expand Down
4 changes: 2 additions & 2 deletions src/handler_reverse.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ error_t handleReverse(HttpConnection *connection, const char_t *uri, const char_
return error;
}

TRACE_INFO("httpServerRequestCallback: (waiting)\r\n");
TRACE_DEBUG("httpServerRequestCallback: (waiting)\r\n");
while (cbr_ctx.status != PROX_STATUS_DONE)
{
osDelayTask(50);
}
error = httpFlushStream(connection);

TRACE_INFO("httpServerRequestCallback: (done)\r\n");
TRACE_DEBUG("httpServerRequestCallback: (done)\r\n");
return error;
}

0 comments on commit ba183a3

Please sign in to comment.