about summary refs log tree commit diff
path: root/server.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-10-02 18:40:19 -0400
committerJune McEnroe <june@causal.agency>2021-10-02 19:51:40 -0400
commitc63c1683414c044a16722e9f1e738dd6ea63ec69 (patch)
tree847a9cca0368e0a5b673c65cf54e2a9f3f6ef59a /server.c
parentExplain what pounce does and some of how it works in README (diff)
downloadpounce-c63c1683414c044a16722e9f1e738dd6ea63ec69.tar.gz
pounce-c63c1683414c044a16722e9f1e738dd6ea63ec69.zip
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.
Diffstat (limited to '')
-rw-r--r--server.c4
1 files changed, 2 insertions, 2 deletions
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, " ");
/sh.l?id=1b43cc7aed8a4062ee1ed779ad4d1fcba1d4f894&follow=1'>Handle subshells (and functions) inside substitutionsJune McEnroe 2022-06-10Switch to jorts Install scriptJune McEnroe 2022-06-08Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe