summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2018-01-11 16:44:36 +0100
committerSébastien Helleu <flashcode@flashtux.org>2018-01-11 16:44:36 +0100
commita4b1952c757e99140d49e8b9d1d8f8a1497d2f01 (patch)
tree2fcab9e52290e8d95afa370bdfab4fcb85ba73f6
parent9b935836e090320e33783c698be82f7684166879 (diff)
downloadweechat-a4b1952c757e99140d49e8b9d1d8f8a1497d2f01.zip
logger: add option logger.look.backlog_conditions (closes #1132)
-rw-r--r--ChangeLog.adoc1
-rw-r--r--doc/de/autogen/user/logger_options.adoc6
-rw-r--r--doc/en/autogen/user/logger_options.adoc6
-rw-r--r--doc/fr/autogen/user/logger_options.adoc6
-rw-r--r--doc/it/autogen/user/logger_options.adoc6
-rw-r--r--doc/ja/autogen/user/logger_options.adoc6
-rw-r--r--doc/pl/autogen/user/logger_options.adoc6
-rw-r--r--po/cs.po8
-rw-r--r--po/de.po8
-rw-r--r--po/es.po8
-rw-r--r--po/fr.po14
-rw-r--r--po/hu.po8
-rw-r--r--po/it.po8
-rw-r--r--po/ja.po8
-rw-r--r--po/pl.po8
-rw-r--r--po/pt.po8
-rw-r--r--po/pt_BR.po8
-rw-r--r--po/ru.po8
-rw-r--r--po/tr.po8
-rw-r--r--po/weechat.pot8
-rw-r--r--src/plugins/logger/logger-config.c11
-rw-r--r--src/plugins/logger/logger-config.h1
-rw-r--r--src/plugins/logger/logger.c88
23 files changed, 217 insertions, 30 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 56c5029ad..0d9636b08 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -25,6 +25,7 @@ New features::
* core: add option "add" in command /buffer (issue #1113)
* core: add option weechat.completion.partial_completion_templates to force partial completion on specific templates
* api: add hashtable with variables in plugin structure
+ * logger: add option logger.look.backlog_conditions (issue #1132)
* scripts: add "eval" option in script commands and info "xxx_eval" (python, perl, ruby, lua and guile) (issue #128)
* scripts: add infos "xxx_interpreter" and "xxx_version" in script plugins (issue #1075)
* scripts: add option "version" in script commands (issue #1075)
diff --git a/doc/de/autogen/user/logger_options.adoc b/doc/de/autogen/user/logger_options.adoc
index 2a5ba2124..d58bd358d 100644
--- a/doc/de/autogen/user/logger_options.adoc
+++ b/doc/de/autogen/user/logger_options.adoc
@@ -79,3 +79,9 @@
** Typ: integer
** Werte: 0 .. 2147483647
** Standardwert: `+20+`
+
+* [[option_logger.look.backlog_conditions]] *logger.look.backlog_conditions*
+** Beschreibung: pass:none[conditions to display the backlog (note: content is evaluated, see /help eval); empty value displays the backlog on all buffers; for example to display backlog on private buffers only: "${type} == private"]
+** Typ: Zeichenkette
+** Werte: beliebige Zeichenkette
+** Standardwert: `+""+`
diff --git a/doc/en/autogen/user/logger_options.adoc b/doc/en/autogen/user/logger_options.adoc
index bb6c518c8..9657012c2 100644
--- a/doc/en/autogen/user/logger_options.adoc
+++ b/doc/en/autogen/user/logger_options.adoc
@@ -79,3 +79,9 @@
** type: integer
** values: 0 .. 2147483647
** default value: `+20+`
+
+* [[option_logger.look.backlog_conditions]] *logger.look.backlog_conditions*
+** description: pass:none[conditions to display the backlog (note: content is evaluated, see /help eval); empty value displays the backlog on all buffers; for example to display backlog on private buffers only: "${type} == private"]
+** type: string
+** values: any string
+** default value: `+""+`
diff --git a/doc/fr/autogen/user/logger_options.adoc b/doc/fr/autogen/user/logger_options.adoc
index 04a7eaae3..c84604110 100644
--- a/doc/fr/autogen/user/logger_options.adoc
+++ b/doc/fr/autogen/user/logger_options.adoc
@@ -79,3 +79,9 @@
** type: entier
** valeurs: 0 .. 2147483647
** valeur par défaut: `+20+`
+
+* [[option_logger.look.backlog_conditions]] *logger.look.backlog_conditions*
+** description: pass:none[conditions pour afficher l'historique (note : le contenu est évalué, voir /help eval) ; une valeur vide affiche l'historique sur tous les tampons ; par exemple pour afficher l'historique seulement sur les tampons privés : "${type} == private"]
+** type: chaîne
+** valeurs: toute chaîne
+** valeur par défaut: `+""+`
diff --git a/doc/it/autogen/user/logger_options.adoc b/doc/it/autogen/user/logger_options.adoc
index 929e00fc9..1c283250b 100644
--- a/doc/it/autogen/user/logger_options.adoc
+++ b/doc/it/autogen/user/logger_options.adoc
@@ -79,3 +79,9 @@
** tipo: intero
** valori: 0 .. 2147483647
** valore predefinito: `+20+`
+
+* [[option_logger.look.backlog_conditions]] *logger.look.backlog_conditions*
+** descrizione: pass:none[conditions to display the backlog (note: content is evaluated, see /help eval); empty value displays the backlog on all buffers; for example to display backlog on private buffers only: "${type} == private"]
+** tipo: stringa
+** valori: qualsiasi stringa
+** valore predefinito: `+""+`
diff --git a/doc/ja/autogen/user/logger_options.adoc b/doc/ja/autogen/user/logger_options.adoc
index 59496c1dd..be87702b8 100644
--- a/doc/ja/autogen/user/logger_options.adoc
+++ b/doc/ja/autogen/user/logger_options.adoc
@@ -79,3 +79,9 @@
** タイプ: 整数
** 値: 0 .. 2147483647
** デフォルト値: `+20+`
+
+* [[option_logger.look.backlog_conditions]] *logger.look.backlog_conditions*
+** 説明: pass:none[conditions to display the backlog (note: content is evaluated, see /help eval); empty value displays the backlog on all buffers; for example to display backlog on private buffers only: "${type} == private"]
+** タイプ: 文字列
+** 値: 未制約文字列
+** デフォルト値: `+""+`
diff --git a/doc/pl/autogen/user/logger_options.adoc b/doc/pl/autogen/user/logger_options.adoc
index 2fea60ca8..1b9d471f7 100644
--- a/doc/pl/autogen/user/logger_options.adoc
+++ b/doc/pl/autogen/user/logger_options.adoc
@@ -79,3 +79,9 @@
** typ: liczba
** wartości: 0 .. 2147483647
** domyślna wartość: `+20+`
+
+* [[option_logger.look.backlog_conditions]] *logger.look.backlog_conditions*
+** opis: pass:none[conditions to display the backlog (note: content is evaluated, see /help eval); empty value displays the backlog on all buffers; for example to display backlog on private buffers only: "${type} == private"]
+** typ: ciąg
+** wartości: dowolny ciąg
+** domyślna wartość: `+""+`
diff --git a/po/cs.po b/po/cs.po
index fdd5cbe2d..0d34422f1 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2018-01-06 13:50+0100\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9729,6 +9729,12 @@ msgstr ""
"maximální počet řádek zobrazených z logovacího souboru při vytvořezí nového "
"bufferu (0 = žádný zpětný log)"
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
#, fuzzy
msgid "color for line ending the backlog"
msgstr "barva textu pro akce ve vstupní řádce"
diff --git a/po/de.po b/po/de.po
index c5ba81bd8..4bd4016ed 100644
--- a/po/de.po
+++ b/po/de.po
@@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2018-01-07 14:46+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -11498,6 +11498,12 @@ msgstr ""
"maximale Anzahl der letzten Zeilen die aus der Protokolldatei dargestellt "
"werden sollen, sobald ein Buffer geöffnet wird (0 = kein Darstellung)"
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
msgid "color for line ending the backlog"
msgstr "Farbe für die letzte Zeile im Verlaufsspeicher"
diff --git a/po/es.po b/po/es.po
index 077044167..7f49a3c23 100644
--- a/po/es.po
+++ b/po/es.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2018-01-06 13:50+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -10055,6 +10055,12 @@ msgstr ""
"máximo número de líneas a mostrar del registro cuando se crea un buffer "
"nuevo (0 = no mostrar nada)"
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
msgid "color for line ending the backlog"
msgstr "color para el final de línea del último registro"
diff --git a/po/fr.po b/po/fr.po
index b81da52ca..848485fdb 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 15:01+0100\n"
-"PO-Revision-Date: 2018-01-08 21:55+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
+"PO-Revision-Date: 2018-01-11 16:03+0100\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -11231,6 +11231,16 @@ msgstr ""
"nombre maximum de lignes à afficher du fichier de log lors de l'ouverture du "
"tampon (0 = ne rien afficher)"
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+"conditions pour afficher l'historique (note : le contenu est évalué, voir /"
+"help eval) ; une valeur vide affiche l'historique sur tous les tampons ; par "
+"exemple pour afficher l'historique seulement sur les tampons privés : "
+"\"${type} == private\""
+
msgid "color for line ending the backlog"
msgstr "couleur pour la ligne de fin de l'historique"
diff --git a/po/hu.po b/po/hu.po
index 7bbe3a047..ba422ba8d 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2018-01-06 13:50+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9080,6 +9080,12 @@ msgid ""
msgstr ""
"felhasználói parancsok maximális száma az előzményekben (0 = korlátlan)"
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
#, fuzzy
msgid "color for line ending the backlog"
msgstr "nevek színe"
diff --git a/po/it.po b/po/it.po
index b6eaf6c52..30b600917 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2018-01-06 13:50+0100\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -10244,6 +10244,12 @@ msgstr ""
"numero massimo di righe da visualizzare dal file di log alla creazione di un "
"nuovo buffer (0 = nessuna cronologia)"
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
msgid "color for line ending the backlog"
msgstr "colore per la riga finale nella cronologia"
diff --git a/po/ja.po b/po/ja.po
index 624e0891c..48443c8cf 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2018-01-08 09:00+0900\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -10801,6 +10801,12 @@ msgid ""
msgstr ""
"新規バッファの作成時にログファイルから表示する行の最大数 (0 = バックログ無し)"
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
msgid "color for line ending the backlog"
msgstr "バックログの最終行の色"
diff --git a/po/pl.po b/po/pl.po
index 7b4c0a98d..4be8453e1 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2018-01-06 13:50+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -10979,6 +10979,12 @@ msgstr ""
"maksymalna ilość linii wyświetlana z logu podczas tworzenia nowego bufora (0 "
"= bez historii)"
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
msgid "color for line ending the backlog"
msgstr "kolor linii kończącej backloga"
diff --git a/po/pt.po b/po/pt.po
index 820947f29..0e269b49e 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2018-01-06 13:50+0100\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -10690,6 +10690,12 @@ msgstr ""
"número máximo de linhas do ficheiro de registo para mostrar ao criar um novo "
"buffer (0 = não apresentar registo)"
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
msgid "color for line ending the backlog"
msgstr "cor da linha que termina o registo recente"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index be3a6d106..06b1eca8e 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2018-01-06 13:50+0100\n"
"Last-Translator: Eduardo Elias <camponez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9563,6 +9563,12 @@ msgstr ""
"número máximo de linhas a exibir do arquivo de registro (backlog) quando um "
"novo buffer for criado (0 = sem backlog)"
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
#, fuzzy
msgid "color for line ending the backlog"
msgstr "cor para o apelido na barra de entrada"
diff --git a/po/ru.po b/po/ru.po
index 2997400de..c6ecf1f7b 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2018-01-06 13:50+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9117,6 +9117,12 @@ msgid ""
"= no backlog)"
msgstr "максимальное количество команд в истории (0 = не ограничено)"
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
#, fuzzy
msgid "color for line ending the backlog"
msgstr "цвет ников"
diff --git a/po/tr.po b/po/tr.po
index 4e3108d27..5c3355628 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2017-06-26 23:33+0200\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8298,6 +8298,12 @@ msgid ""
"= no backlog)"
msgstr ""
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
msgid "color for line ending the backlog"
msgstr ""
diff --git a/po/weechat.pot b/po/weechat.pot
index 9565ae67c..284bb32a6 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2018-01-08 21:58+0100\n"
+"POT-Creation-Date: 2018-01-11 15:55+0100\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8180,6 +8180,12 @@ msgid ""
"= no backlog)"
msgstr ""
+msgid ""
+"conditions to display the backlog (note: content is evaluated, see /help "
+"eval); empty value displays the backlog on all buffers; for example to "
+"display backlog on private buffers only: \"${type} == private\""
+msgstr ""
+
msgid "color for line ending the backlog"
msgstr ""
diff --git a/src/plugins/logger/logger-config.c b/src/plugins/logger/logger-config.c
index ef6e976c4..4aa124e15 100644
--- a/src/plugins/logger/logger-config.c
+++ b/src/plugins/logger/logger-config.c
@@ -36,6 +36,7 @@ int logger_config_loading = 0;
/* logger config, look section */
struct t_config_option *logger_config_look_backlog;
+struct t_config_option *logger_config_look_backlog_conditions;
/* logger config, color section */
@@ -397,6 +398,16 @@ logger_config_init ()
"new buffer (0 = no backlog)"),
NULL, 0, INT_MAX, "20", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ logger_config_look_backlog_conditions = weechat_config_new_option (
+ logger_config_file, ptr_section,
+ "backlog_conditions", "string",
+ N_("conditions to display the backlog "
+ "(note: content is evaluated, see /help eval); "
+ "empty value displays the backlog on all buffers; "
+ "for example to display backlog on private buffers only: "
+ "\"${type} == private\""),
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* color */
ptr_section = weechat_config_new_section (logger_config_file, "color",
diff --git a/src/plugins/logger/logger-config.h b/src/plugins/logger/logger-config.h
index 959df7120..203372031 100644
--- a/src/plugins/logger/logger-config.h
+++ b/src/plugins/logger/logger-config.h
@@ -24,6 +24,7 @@
extern struct t_config_option *logger_config_look_backlog;
+extern struct t_config_option *logger_config_look_backlog_conditions;
extern struct t_config_option *logger_config_color_backlog_end;
extern struct t_config_option *logger_config_color_backlog_line;
diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c
index 5194d12dd..ab55fcaac 100644
--- a/src/plugins/logger/logger.c
+++ b/src/plugins/logger/logger.c
@@ -954,6 +954,62 @@ logger_buffer_renamed_signal_cb (const void *pointer, void *data,
}
/*
+ * Checks conditions to display the backlog.
+ *
+ * Returns:
+ * 1: conditions OK (backlog is displayed)
+ * 0: conditions not OK (backlog is NOT displayed)
+ */
+
+int
+logger_backlog_check_conditions (struct t_gui_buffer *buffer)
+{
+ struct t_hashtable *pointers, *options;
+ const char *ptr_condition;
+ char *result;
+ int condition_ok;
+
+ ptr_condition = weechat_config_string (logger_config_look_backlog_conditions);
+
+ /* empty condition displays the backlog everywhere */
+ if (!ptr_condition || !ptr_condition[0])
+ return 1;
+
+ pointers = weechat_hashtable_new (32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_POINTER,
+ NULL,
+ NULL);
+ if (pointers)
+ {
+ weechat_hashtable_set (pointers, "window",
+ weechat_window_search_with_buffer (buffer));
+ weechat_hashtable_set (pointers, "buffer", buffer);
+ }
+
+ options = weechat_hashtable_new (32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING,
+ NULL,
+ NULL);
+ if (options)
+ weechat_hashtable_set (options, "type", "condition");
+
+ result = weechat_string_eval_expression (ptr_condition,
+ pointers, NULL, options);
+ condition_ok = (result && (strcmp (result, "1") == 0));
+ if (result)
+ free (result);
+
+ if (pointers)
+ weechat_hashtable_free (pointers);
+ if (options)
+ weechat_hashtable_free (options);
+
+ return condition_ok;
+}
+
+/*
* Displays backlog for a buffer (by reading end of log file).
*/
@@ -1053,24 +1109,24 @@ logger_backlog_signal_cb (const void *pointer, void *data,
(void) signal;
(void) type_data;
- if (weechat_config_integer (logger_config_look_backlog) >= 0)
- {
- ptr_logger_buffer = logger_buffer_search_buffer (signal_data);
- if (ptr_logger_buffer && ptr_logger_buffer->log_enabled)
- {
- if (!ptr_logger_buffer->log_filename)
- logger_set_log_filename (ptr_logger_buffer);
-
- if (ptr_logger_buffer->log_filename)
- {
- ptr_logger_buffer->log_enabled = 0;
+ if (weechat_config_integer (logger_config_look_backlog) == 0)
+ return WEECHAT_RC_OK;
- logger_backlog (signal_data,
- ptr_logger_buffer->log_filename,
- weechat_config_integer (logger_config_look_backlog));
+ if (!logger_backlog_check_conditions (signal_data))
+ return WEECHAT_RC_OK;
- ptr_logger_buffer->log_enabled = 1;
- }
+ ptr_logger_buffer = logger_buffer_search_buffer (signal_data);
+ if (ptr_logger_buffer && ptr_logger_buffer->log_enabled)
+ {
+ if (!ptr_logger_buffer->log_filename)
+ logger_set_log_filename (ptr_logger_buffer);
+ if (ptr_logger_buffer->log_filename)
+ {
+ ptr_logger_buffer->log_enabled = 0;
+ logger_backlog (signal_data,
+ ptr_logger_buffer->log_filename,
+ weechat_config_integer (logger_config_look_backlog));
+ ptr_logger_buffer->log_enabled = 1;
}
}