Remove color from syslog messages
authorArt Cancro <ajc@citadel.org>
Wed, 28 Dec 2022 04:18:24 +0000 (23:18 -0500)
committerArt Cancro <ajc@citadel.org>
Wed, 28 Dec 2022 04:18:24 +0000 (23:18 -0500)
citadel/citadel.lock [new file with mode: 0644]
webcit-ng/server/ctdlclient.c
webcit-ng/server/http.c

diff --git a/citadel/citadel.lock b/citadel/citadel.lock
new file mode 100644 (file)
index 0000000..e69de29
index fa35595e66152e12b0a23461a11001a23ba415db..55ddb19b812d345216c82c465ae39520d8820801 100644 (file)
@@ -50,12 +50,12 @@ int ctdl_readline(struct ctdlsession *ctdl, char *buf, int maxbytes) {
                                --len;
                        }
                        buf[len] = 0;
-                       // syslog(LOG_DEBUG, "\033[32m[ %s\033[0m", buf);
+                       // syslog(LOG_DEBUG, "[ %s", buf);
                        return (len);
                }
                ++len;
        }
-       // syslog(LOG_DEBUG, "\033[32m[ %s\033[0m", buf);
+       // syslog(LOG_DEBUG, "[ %s", buf);
        return (len);
 }
 
@@ -94,7 +94,7 @@ void ctdl_printf(struct ctdlsession *ctdl, const char *format, ...) {
        StrBufVAppendPrintf(Buf, format, arg_ptr);
        va_end(arg_ptr);
 
-       // syslog(LOG_DEBUG, "\033[32m] %s\033[0m", ChrPtr(Buf));
+       // syslog(LOG_DEBUG, "] %s", ChrPtr(Buf));
        ctdl_write(ctdl, (char *) ChrPtr(Buf), StrLength(Buf));
        ctdl_write(ctdl, "\n", 1);
        FreeStrBuf(&Buf);
index 161c070f52a6a13f3af4b8e3f6beb3052bdc02a9..82fd5f3c258cc07cbafcd3e2b71a23acfa2256d1 100644 (file)
@@ -144,7 +144,7 @@ void perform_one_http_transaction(struct client_handle *ch) {
                                string_trim(new_request_header.val);
                                array_append(h.request_headers, &new_request_header);
 #ifdef DEBUG_HTTP
-                               syslog(LOG_DEBUG, "\033[1m\033[35m{ %s: %s\033[0m", new_request_header.key, new_request_header.val);
+                               syslog(LOG_DEBUG, "{ %s: %s", new_request_header.key, new_request_header.val);
 #endif
                        }
                }
@@ -166,7 +166,7 @@ void perform_one_http_transaction(struct client_handle *ch) {
                                kv.val = strdup(eq);
                                array_append(h.request_parms, &kv);
 #ifdef DEBUG_HTTP
-                               syslog(LOG_DEBUG, "\033[1m\033[33m| %s = %s\033[0m", kv.key, kv.val);
+                               syslog(LOG_DEBUG, "| %s = %s", kv.key, kv.val);
 #endif
                        }
                }
@@ -193,7 +193,7 @@ void perform_one_http_transaction(struct client_handle *ch) {
        }
        else {
 //#ifdef DEBUG_HTTP
-               syslog(LOG_DEBUG, "\033[33m\033[1m< %s %s\033[0m", h.method, h.url);
+               syslog(LOG_DEBUG, "< %s %s", h.method, h.url);
 //#endif
 
                // If there is a request body, read it now.
@@ -208,9 +208,9 @@ void perform_one_http_transaction(struct client_handle *ch) {
 
                        // Write the entire request body to stderr -- not what you want during normal operation.
                        #ifdef BODY_TO_STDERR
-                       write(2, HKEY("\033[31m"));
+                       write(2, HKEY("---\n"));
                        write(2, h.request_body, h.request_body_length);
-                       write(2, HKEY("\033[0m\n"));
+                       write(2, HKEY("---\n"));
                        #endif
 
                }
@@ -220,14 +220,14 @@ void perform_one_http_transaction(struct client_handle *ch) {
 
                // Write the entire response body to stderr -- not what you want during normal operation.
                #ifdef BODY_TO_STDERR
-               write(2, HKEY("\033[32m"));
+               write(2, HKEY("---\n"));
                write(2, h.response_body, h.response_body_length);
-               write(2, HKEY("\033[0m\n"));
+               write(2, HKEY("---\n"));
                #endif
 
                // Output the results back to the client.
 #ifdef DEBUG_HTTP
-               syslog(LOG_DEBUG, "\033[33m\033[1m> %03d %s\033[0m", h.response_code, h.response_string);
+               syslog(LOG_DEBUG, "> %03d %s", h.response_code, h.response_string);
 #endif
                client_printf(ch, "HTTP/1.1 %03d %s\r\n", h.response_code, h.response_string);
                client_printf(ch, "Connection: close\r\n");
@@ -243,7 +243,7 @@ void perform_one_http_transaction(struct client_handle *ch) {
                for (i=0; i<number_of_response_headers; ++i) {
                        struct keyval *kv = array_get_element_at(h.response_headers, i);
 #ifdef DEBUG_HTTP
-                       syslog(LOG_DEBUG, "\033[1m\033[35m} %s: %s\033[0m", kv->key, kv->val);
+                       syslog(LOG_DEBUG, "} %s: %s", kv->key, kv->val);
 #endif
                        client_printf(ch, "%s: %s\r\n", kv->key, kv->val);
                }