diff options
-rw-r--r-- | docs/help/in/log.in | 3 | ||||
-rw-r--r-- | src/fe-common/core/fe-log.c | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/docs/help/in/log.in b/docs/help/in/log.in index db952773..332ba85e 100644 --- a/docs/help/in/log.in +++ b/docs/help/in/log.in @@ -5,7 +5,8 @@ -autoopen: Automatically open this log file at startup -<server tag>: Targets are logged only in this server -targets: Log only in specified channels/nicks (space separated list) - -window: Log the active window + -window: Log output in the window. Active window is used by default, or + you can give the window's refnum in -targets. <filename>: File name where to log, it is parsed with strftime(), so %%d=day, etc. see "man strftime" for more info. diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c index 477307f4..99c82ca1 100644 --- a/src/fe-common/core/fe-log.c +++ b/src/fe-common/core/fe-log.c @@ -96,8 +96,12 @@ static void cmd_log_open(const char *data) if (g_hash_table_lookup(optlist, "window")) { /* log by window ref# */ - ltoa(window, active_win->refnum); - log_item_add(log, LOG_ITEM_WINDOW_REFNUM, window, + targetarg = g_hash_table_lookup(optlist, "targets"); + if (targetarg == NULL || !is_numeric(targetarg, '\0')) { + ltoa(window, active_win->refnum); + targetarg = window; + } + log_item_add(log, LOG_ITEM_WINDOW_REFNUM, targetarg, servertag); } else { targetarg = g_hash_table_lookup(optlist, "targets"); |