diff options
author | June McEnroe <june@causal.agency> | 2021-10-02 18:40:19 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-10-02 19:51:40 -0400 |
commit | c63c1683414c044a16722e9f1e738dd6ea63ec69 (patch) | |
tree | 847a9cca0368e0a5b673c65cf54e2a9f3f6ef59a /client.c | |
parent | Explain what pounce does and some of how it works in README (diff) | |
download | pounce-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-- | client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client.c b/client.c index bad8c11..de7b2c9 100644 --- a/client.c +++ b/client.c @@ -86,7 +86,7 @@ void clientFree(struct Client *client) { } void clientSend(struct Client *client, const char *ptr, size_t len) { - if (verbose) fprintf(stderr, "<- %.*s", (int)len, ptr); + verboseLog("<-", ptr, len); fcntl(client->sock, F_SETFL, 0); while (len) { ssize_t ret = tls_write(client->tls, ptr, len); @@ -409,7 +409,7 @@ void clientRecv(struct Client *client) { for (;;) { lf = memchr(line, '\n', &client->buf[client->len] - line); if (!lf) break; - if (verbose) fprintf(stderr, "-> %.*s\n", (int)(lf - line), line); + verboseLog("->", line, lf - line); if (client->need || intercept(line, lf - line)) { lf[0] = '\0'; if (lf - line && lf[-1] == '\r') lf[-1] = '\0'; |