From c63c1683414c044a16722e9f1e738dd6ea63ec69 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sat, 2 Oct 2021 18:40:19 -0400 Subject: Log IRC to standard output with -v So that it can actually be logged to a file separate from any errors or status messages. Also make sure only LF is used when logging. --- server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server.c') diff --git a/server.c b/server.c index 6640f8f..552f521 100644 --- a/server.c +++ b/server.c @@ -168,7 +168,7 @@ void serverPrintCert(void) { } void serverSend(const char *ptr, size_t len) { - if (verbose) fprintf(stderr, "<< %.*s", (int)len, ptr); + verboseLog("<<", ptr, len); while (len) { ssize_t ret = tls_write(client, ptr, len); if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) continue; @@ -244,7 +244,7 @@ void serverRecv(void) { crlf = memmem(line, &buf[len] - line, "\r\n", 2); if (!crlf) break; crlf[0] = '\0'; - if (verbose) fprintf(stderr, ">> %s\n", line); + verboseLog(">>", line, crlf - line); const char *ping = line; if (ping[0] == '@') { ping += strcspn(ping, " "); -- cgit 1.4.1