summaryrefslogtreecommitdiff
path: root/src/core/log.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-08-11 20:13:49 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-08-11 20:13:49 +0000
commit82d272799c0c542bddb725c2ea73e85045bb22d7 (patch)
tree1ca927c352f9786500fb5dea772e846ea8ba6b2c /src/core/log.c
parent8eb324accc8d47aeb80a32654265d26f54e0d4e6 (diff)
downloadirssi-82d272799c0c542bddb725c2ea73e85045bb22d7.zip
Autologging fixes: Don't log WHOIS replies by default
(autolog_level = all -crap). And with /msg nick1,nick2 don't log to file nick1,nick2.log but nick1.log and nick2.log separately. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@585 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/log.c')
-rw-r--r--src/core/log.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/log.c b/src/core/log.c
index 0069d329..481c6b96 100644
--- a/src/core/log.c
+++ b/src/core/log.c
@@ -347,13 +347,24 @@ static void sig_printtext_stripped(void *window, void *server,
const char *item, gpointer levelp,
const char *str)
{
+ char **items, **tmp;
int level;
g_return_if_fail(str != NULL);
level = GPOINTER_TO_INT(levelp);
- if (logs != NULL && level != MSGLEVEL_NEVER)
- log_file_write(item, level, str, FALSE);
+ if (logs == NULL || level == MSGLEVEL_NEVER)
+ return;
+
+ if (item == NULL)
+ log_file_write(NULL, level, str, FALSE);
+ else {
+ /* there can be multiple items separated with comma */
+ items = g_strsplit(item, ",", -1);
+ for (tmp = items; *tmp != NULL; tmp++)
+ log_file_write(*tmp, level, str, FALSE);
+ g_strfreev(items);
+ }
}
static int sig_rotate_check(void)