From e31b09f41e9b8a65b9e1f47eb4a9254aa8c0822e Mon Sep 17 00:00:00 2001 From: kakwa Date: Thu, 8 Sep 2016 21:18:15 +0200 Subject: [PATCH] adding a switch to disable request debug log treatement --- src/lib/http.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/http.c b/src/lib/http.c index 7b0a94c..fcd935f 100644 --- a/src/lib/http.c +++ b/src/lib/http.c @@ -30,7 +30,10 @@ static char *rand_string(char *str, size_t size) { } void log_request_debug(const struct mg_request_info *request_info, - char *request_id, void *context) { + char *request_id, rfc3161_context *context) { + if (LOG_DEBUG > context->loglevel && !context->stdout_dbg) + return; + for (int i = 0; i < request_info->num_headers; i++) { uts_logger(context, LOG_DEBUG, "Request[%s], Header[%s]: %s", request_id, request_info->http_headers[i].name, @@ -63,7 +66,10 @@ void log_request_debug(const struct mg_request_info *request_info, } void log_request(const struct mg_request_info *request_info, char *request_id, - void *context, int response_code, int timer) { + rfc3161_context *context, int response_code, int timer) { + if (LOG_INFO > context->loglevel && !context->stdout_dbg) + return; + const char *user_agent = NULL; const char *content_type = NULL;