diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-12-22 16:01:16 +0000 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-12-22 16:01:16 +0000 |
commit | 85dd88a180043e991c19a4c93a6ce5c7fe0a6e88 (patch) | |
tree | 2866cf5772eb3e0e2da4be0a86fc5a07b499b174 /logging.c | |
parent | 2385f7b944bb22acd85e6c089e509880a45a2cb1 (diff) |
Make full debug output optional for extractnickfromprefix() and stripprefix() to avoid huge debug logs when using replaymode = "lastspoke" combined with DEBUG_FULL.
Diffstat (limited to 'logging.c')
-rw-r--r-- | logging.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -126,11 +126,11 @@ int logline(char *str, struct ircdstate *ircdstate, char *basedir, int type) { switch(type) { case LOG_PRIVMSG: // Extract the username from the prefix - extractnickfromprefix(tokens[0]); - extractnickfromprefix(from); + extractnickfromprefix(tokens[0], 1); + extractnickfromprefix(from, 1); // Remove the leading ":" from the real message - stripprefix(str); + stripprefix(str, 1); // Build the log filename // If the message was sent to us, then log it in the sender's log file @@ -211,10 +211,10 @@ int logline(char *str, struct ircdstate *ircdstate, char *basedir, int type) { case LOG_TOPIC: // Extract the username from the prefix - extractnickfromprefix(tokens[0]); + extractnickfromprefix(tokens[0], 1); // Remove the leading ":" from the topic - stripprefix(str); + stripprefix(str, 1); if (!snprintf(filename, MAXCHAR, "%s/logs/%s.log", basedir, to)) { debugprint(DEBUG_CRIT, "Error while preparing log filename for topic, returning!\n"); @@ -265,7 +265,7 @@ int logline(char *str, struct ircdstate *ircdstate, char *basedir, int type) { tokens[1][posbang] = '\0'; // Strip the prefix from the quit message - stripprefix(str); + stripprefix(str, 1); // Build a friendly message (e.g. "nick (user@host) has quit (Quit: message)") snprintf(line, MAXCHAR, "%s (%s) has quit (%s)", tokens[1] + 1, tokens[1] + posbang + 1, str); @@ -280,9 +280,9 @@ int logline(char *str, struct ircdstate *ircdstate, char *basedir, int type) { case LOG_NICK: // Extract old nick from the prefix - extractnickfromprefix(tokens[1]); + extractnickfromprefix(tokens[1], 1); // Strip colon from new nick - stripprefix(str); + stripprefix(str, 1); // Build a friendly message (e.g. "oldnick is now known as newnick") snprintf(line, MAXCHAR, "%s is now known as %s", tokens[1], str); @@ -297,7 +297,7 @@ int logline(char *str, struct ircdstate *ircdstate, char *basedir, int type) { case LOG_MODE: // Extract nick from prefix - extractnickfromprefix(tokens[0]); + extractnickfromprefix(tokens[0], 1); // Build a friendly message (e.g. "nick sets mode #channel +ov nick1 nick2") if (!snprintf(line, MAXCHAR, "%s sets mode %s %s", tokens[0], tokens[2], str)) { |