From fbf38ddbd58a7fc71ca8c99b3e3ec400c0aee690 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 28 Mar 2012 21:48:55 +0200 Subject: [PATCH] logger: add colors for backlog lines and end of backlog (task #11966) --- ChangeLog | 1 + doc/de/autogen/user/logger_options.txt | 10 +++++++ doc/en/autogen/user/logger_options.txt | 10 +++++++ doc/fr/autogen/user/logger_options.txt | 10 +++++++ doc/it/autogen/user/logger_options.txt | 10 +++++++ po/cs.po | 14 +++++++-- po/de.po | 14 +++++++-- po/es.po | 14 +++++++-- po/fr.po | 14 ++++++--- po/hu.po | 12 ++++++-- po/it.po | 14 +++++++-- po/ja.po | 14 +++++++-- po/pl.po | 14 +++++++-- po/pt_BR.po | 14 +++++++-- po/ru.po | 12 ++++++-- po/weechat.pot | 10 +++++-- src/plugins/logger/logger-config.c | 28 ++++++++++++++++++ src/plugins/logger/logger-config.h | 3 ++ src/plugins/logger/logger.c | 40 ++++++++++++-------------- 19 files changed, 206 insertions(+), 52 deletions(-) diff --git a/ChangeLog b/ChangeLog index af243639d..9336346c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -42,6 +42,7 @@ Version 0.3.8 (under dev!) * irc: add support of "external" SASL mechanism (task #11864) * irc: close server buffer when server is deleted * irc: add search for lower case nicks in option irc.look.nick_color_force +* logger: add colors for backlog lines and end of backlog (task #11966) * relay: redirect some irc messages from clients to hide output (messages: mode, ison, list, names, topic, who, whois, whowas, time, userhost) (bug #33516) * relay: add "date_printed" and "highlight" in signal "_buffer_line_added" diff --git a/doc/de/autogen/user/logger_options.txt b/doc/de/autogen/user/logger_options.txt index ba15a506b..100bf2f4f 100644 --- a/doc/de/autogen/user/logger_options.txt +++ b/doc/de/autogen/user/logger_options.txt @@ -1,3 +1,13 @@ +* [[option_logger.color.backlog_end]] *logger.color.backlog_end* +** Beschreibung: `color for line ending the backlog` +** Typ: Farbe +** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "_" für unterstrichen (Standardwert: `darkgray`) + +* [[option_logger.color.backlog_line]] *logger.color.backlog_line* +** Beschreibung: `color for backlog lines` +** Typ: Farbe +** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "_" für unterstrichen (Standardwert: `darkgray`) + * [[option_logger.file.auto_log]] *logger.file.auto_log* ** Beschreibung: `speichert automatisch den Inhalt eines Buffers in eine Datei (sofern das Protokollieren für den Buffer nicht deaktiviert sein sollte)` ** Typ: boolesch diff --git a/doc/en/autogen/user/logger_options.txt b/doc/en/autogen/user/logger_options.txt index 124d57f3c..57efc30a4 100644 --- a/doc/en/autogen/user/logger_options.txt +++ b/doc/en/autogen/user/logger_options.txt @@ -1,3 +1,13 @@ +* [[option_logger.color.backlog_end]] *logger.color.backlog_end* +** description: `color for line ending the backlog` +** type: color +** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "_" for underline (default value: `darkgray`) + +* [[option_logger.color.backlog_line]] *logger.color.backlog_line* +** description: `color for backlog lines` +** type: color +** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "_" for underline (default value: `darkgray`) + * [[option_logger.file.auto_log]] *logger.file.auto_log* ** description: `automatically save content of buffers to files (unless a buffer disables log)` ** type: boolean diff --git a/doc/fr/autogen/user/logger_options.txt b/doc/fr/autogen/user/logger_options.txt index 63fe4367a..5f46009a8 100644 --- a/doc/fr/autogen/user/logger_options.txt +++ b/doc/fr/autogen/user/logger_options.txt @@ -1,3 +1,13 @@ +* [[option_logger.color.backlog_end]] *logger.color.backlog_end* +** description: `couleur pour la ligne de fin de l'historique` +** type: couleur +** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné (valeur par défaut: `darkgray`) + +* [[option_logger.color.backlog_line]] *logger.color.backlog_line* +** description: `couleur pour les lignes de l'historique` +** type: couleur +** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné (valeur par défaut: `darkgray`) + * [[option_logger.file.auto_log]] *logger.file.auto_log* ** description: `sauve automatiquement le contenu des tampons dans des fichiers (sauf si un tampon désactive le log)` ** type: booléen diff --git a/doc/it/autogen/user/logger_options.txt b/doc/it/autogen/user/logger_options.txt index 5b46b10e8..7dfd82005 100644 --- a/doc/it/autogen/user/logger_options.txt +++ b/doc/it/autogen/user/logger_options.txt @@ -1,3 +1,13 @@ +* [[option_logger.color.backlog_end]] *logger.color.backlog_end* +** descrizione: `color for line ending the backlog` +** tipo: colore +** valori: un nome colore di WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numero colore del terminale o un alias; attributi consentiti prima del colore (solo per il colore del testo, non lo sfondo): "*" per il grassetto, "!" per l'inverso, "_" per la sottolineatura (valore predefinito: `darkgray`) + +* [[option_logger.color.backlog_line]] *logger.color.backlog_line* +** descrizione: `color for backlog lines` +** tipo: colore +** valori: un nome colore di WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numero colore del terminale o un alias; attributi consentiti prima del colore (solo per il colore del testo, non lo sfondo): "*" per il grassetto, "!" per l'inverso, "_" per la sottolineatura (valore predefinito: `darkgray`) + * [[option_logger.file.auto_log]] *logger.file.auto_log* ** descrizione: `salva automaticamente il contenuto dei buffer su file (a meno che un buffer disabiliti il log)` ** tipo: bool diff --git a/po/cs.po b/po/cs.po index ead6c25db..ca5537398 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-28 15:03+0200\n" +"POT-Creation-Date: 2012-03-28 21:44+0200\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -6802,8 +6802,8 @@ msgstr "logování nebylo spuštěno" msgid "%s: \"%s\" => level %d" msgstr "%s: \"%s\" => úroveň %d" -#, c-format -msgid "===\t========== End of backlog (%d lines) ==========" +#, fuzzy, c-format +msgid "%s===\t%s========== End of backlog (%d lines) ==========" msgstr "===\t========== Konec zpětného logu (%d řádků) ==========" msgid "logger plugin configuration" @@ -6887,6 +6887,14 @@ msgstr "" "maximální počet řádek zobrazených z logovacího souboru při vytvořezí nového " "bufferu (0 = žádný zpětný log)" +#, fuzzy +msgid "color for backlog lines" +msgstr "barva položek, které jsou pryč" + +#, fuzzy +msgid "color for line ending the backlog" +msgstr "barva přezdívky ve vstupním poli" + msgid "" "automatically save content of buffers to files (unless a buffer disables log)" msgstr "" diff --git a/po/de.po b/po/de.po index c6841ac96..40b11b33d 100644 --- a/po/de.po +++ b/po/de.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-28 18:08+0200\n" +"POT-Creation-Date: 2012-03-28 21:44+0200\n" "PO-Revision-Date: 2012-03-27 22:46+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -7287,8 +7287,8 @@ msgstr "Protokollierung wurde nicht gestartet" msgid "%s: \"%s\" => level %d" msgstr "%s: \"%s\" => Level %d" -#, c-format -msgid "===\t========== End of backlog (%d lines) ==========" +#, fuzzy, c-format +msgid "%s===\t%s========== End of backlog (%d lines) ==========" msgstr "===\t========== Ende der Rückverfolgung (%d Zeilen) ==========" msgid "logger plugin configuration" @@ -7380,6 +7380,14 @@ msgstr "" "maximale Anzahl der letzten Zeilen die aus der Protokolldatei dargestellt " "werden sollen, sobald ein Buffer geöffnet wird (0 = kein Darstellung)" +#, fuzzy +msgid "color for backlog lines" +msgstr "Farbe des Abwesenheit-Textes in der Eingabezeile" + +#, fuzzy +msgid "color for line ending the backlog" +msgstr "Farbe des eigenen Nicknamens in der Eingabezeile" + msgid "" "automatically save content of buffers to files (unless a buffer disables log)" msgstr "" diff --git a/po/es.po b/po/es.po index 8c0cb00ff..25904a48c 100644 --- a/po/es.po +++ b/po/es.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-28 15:03+0200\n" +"POT-Creation-Date: 2012-03-28 21:44+0200\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -7046,8 +7046,8 @@ msgstr "registro no iniciado" msgid "%s: \"%s\" => level %d" msgstr "%s: \"%s\" => nivel %d" -#, c-format -msgid "===\t========== End of backlog (%d lines) ==========" +#, fuzzy, c-format +msgid "%s===\t%s========== End of backlog (%d lines) ==========" msgstr "===\t========== Fin del último registro (%d líneas) ==========" msgid "logger plugin configuration" @@ -7135,6 +7135,14 @@ msgstr "" "máximo número de líneas a mostrar del registro cuando se crea un buffer " "nuevo (0 = no mostrar nada)" +#, fuzzy +msgid "color for backlog lines" +msgstr "color para el texto \"ausente\" en al barra de entrada" + +#, fuzzy +msgid "color for line ending the backlog" +msgstr "color para el apodo en la barra de entrada" + msgid "" "automatically save content of buffers to files (unless a buffer disables log)" msgstr "" diff --git a/po/fr.po b/po/fr.po index 0111dcc0f..c10ea89a4 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-28 15:03+0200\n" -"PO-Revision-Date: 2012-03-28 15:03+0200\n" +"POT-Creation-Date: 2012-03-28 21:44+0200\n" +"PO-Revision-Date: 2012-03-28 21:45+0200\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -7109,8 +7109,8 @@ msgid "%s: \"%s\" => level %d" msgstr "%s: \"%s\" => niveau %d" #, c-format -msgid "===\t========== End of backlog (%d lines) ==========" -msgstr "===\t========== Fin de l'historique (%d lignes) ==========" +msgid "%s===\t%s========== End of backlog (%d lines) ==========" +msgstr "%s===\t%s========== Fin de l'historique (%d lignes) ==========" msgid "logger plugin configuration" msgstr "configuration de l'extension logger" @@ -7196,6 +7196,12 @@ msgstr "" "nombre maximum de lignes à afficher du fichier de log lors de l'ouverture du " "tampon (0 = ne rien afficher)" +msgid "color for backlog lines" +msgstr "couleur pour les lignes de l'historique" + +msgid "color for line ending the backlog" +msgstr "couleur pour la ligne de fin de l'historique" + msgid "" "automatically save content of buffers to files (unless a buffer disables log)" msgstr "" diff --git a/po/hu.po b/po/hu.po index 88b48f79a..31affa39d 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-28 15:03+0200\n" +"POT-Creation-Date: 2012-03-28 21:44+0200\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -6362,7 +6362,7 @@ msgid "%s: \"%s\" => level %d" msgstr "A \"%s\" aliasz eltávolítva\n" #, c-format -msgid "===\t========== End of backlog (%d lines) ==========" +msgid "%s===\t%s========== End of backlog (%d lines) ==========" msgstr "" #, fuzzy @@ -6417,6 +6417,14 @@ msgid "" msgstr "" "felhasználói parancsok maximális száma az előzményekben (0 = korlátlan)" +#, fuzzy +msgid "color for backlog lines" +msgstr "távollevő felhasználók nevének színe" + +#, fuzzy +msgid "color for line ending the backlog" +msgstr "nevek színe" + msgid "" "automatically save content of buffers to files (unless a buffer disables log)" msgstr "" diff --git a/po/it.po b/po/it.po index 47f9a8334..ad1d6ed17 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-28 15:03+0200\n" +"POT-Creation-Date: 2012-03-28 21:44+0200\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -7032,8 +7032,8 @@ msgstr "log non iniziato" msgid "%s: \"%s\" => level %d" msgstr "%s: \"%s\" => livello %d" -#, c-format -msgid "===\t========== End of backlog (%d lines) ==========" +#, fuzzy, c-format +msgid "%s===\t%s========== End of backlog (%d lines) ==========" msgstr "===\t========== Fine del backlog (%d righe) ==========" msgid "logger plugin configuration" @@ -7120,6 +7120,14 @@ msgstr "" "numero massimo di righe da visualizzare dal file di log alla creazione di un " "nuovo buffer (0 = nessun backlog)" +#, fuzzy +msgid "color for backlog lines" +msgstr "colore per l'elemento assenza" + +#, fuzzy +msgid "color for line ending the backlog" +msgstr "colore per il nick nella riga di input" + msgid "" "automatically save content of buffers to files (unless a buffer disables log)" msgstr "" diff --git a/po/ja.po b/po/ja.po index 4b595af62..cfa0e7f99 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-28 15:03+0200\n" +"POT-Creation-Date: 2012-03-28 21:44+0200\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: \"AYANOKOUZI, Ryuunosuke\" \n" "Language-Team: Japanese\n" @@ -6865,8 +6865,8 @@ msgstr "ログ保存が開始されていません" msgid "%s: \"%s\" => level %d" msgstr "%s: \"%s\" => レベル %d" -#, c-format -msgid "===\t========== End of backlog (%d lines) ==========" +#, fuzzy, c-format +msgid "%s===\t%s========== End of backlog (%d lines) ==========" msgstr "===\t========== バックログの最後 (%d 行) ==========" msgid "logger plugin configuration" @@ -6948,6 +6948,14 @@ msgid "" msgstr "" "新規バッファの作成時にログファイルから表示する行の最大数 (0 = バックログ無し)" +#, fuzzy +msgid "color for backlog lines" +msgstr "離席アイテムに使う色" + +#, fuzzy +msgid "color for line ending the backlog" +msgstr "インプットバーのニックネームに使う色" + msgid "" "automatically save content of buffers to files (unless a buffer disables log)" msgstr "" diff --git a/po/pl.po b/po/pl.po index 81f7cef28..ea2a8b2a8 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-28 15:03+0200\n" +"POT-Creation-Date: 2012-03-28 21:44+0200\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -6994,8 +6994,8 @@ msgstr "log nie uruchomiony" msgid "%s: \"%s\" => level %d" msgstr "%s: \"%s\" => poziom %d" -#, c-format -msgid "===\t========== End of backlog (%d lines) ==========" +#, fuzzy, c-format +msgid "%s===\t%s========== End of backlog (%d lines) ==========" msgstr "===\t========== Koniec backloga (%d linii) ==========" msgid "logger plugin configuration" @@ -7079,6 +7079,14 @@ msgstr "" "maksymalna ilość linii wyświetlana z logu podczas tworzenia nowego bufora (0 " "= bez historii)" +#, fuzzy +msgid "color for backlog lines" +msgstr "kolor elementu nieobecności" + +#, fuzzy +msgid "color for line ending the backlog" +msgstr "kolor nicka w pasku danych wejściowych" + msgid "" "automatically save content of buffers to files (unless a buffer disables log)" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 708987d51..05047e09b 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-28 15:03+0200\n" +"POT-Creation-Date: 2012-03-28 21:44+0200\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -6515,8 +6515,8 @@ msgstr "registro não iniciou" msgid "%s: \"%s\" => level %d" msgstr "%s: \"%s\" => nível %d" -#, c-format -msgid "===\t========== End of backlog (%d lines) ==========" +#, fuzzy, c-format +msgid "%s===\t%s========== End of backlog (%d lines) ==========" msgstr "===\t========== Fim do backlog (%d linhas) ==========" msgid "logger plugin configuration" @@ -6572,6 +6572,14 @@ msgstr "" "número máximo de linhas a exibir do arquivo de registro (backlog) quando um " "novo buffer for criado (0 = sem backlog)" +#, fuzzy +msgid "color for backlog lines" +msgstr "cor de texto para valores" + +#, fuzzy +msgid "color for line ending the backlog" +msgstr "cor para o apelido na barra de entrada" + msgid "" "automatically save content of buffers to files (unless a buffer disables log)" msgstr "" diff --git a/po/ru.po b/po/ru.po index ae097944b..9d264e3a6 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.8-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-28 15:03+0200\n" +"POT-Creation-Date: 2012-03-28 21:44+0200\n" "PO-Revision-Date: 2012-02-26 09:16+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -6388,7 +6388,7 @@ msgid "%s: \"%s\" => level %d" msgstr "Сокращение \"%s\" удалено\n" #, c-format -msgid "===\t========== End of backlog (%d lines) ==========" +msgid "%s===\t%s========== End of backlog (%d lines) ==========" msgstr "" #, fuzzy @@ -6442,6 +6442,14 @@ msgid "" "= no backlog)" msgstr "максимальное количество команд в истории (0 = не ограничено)" +#, fuzzy +msgid "color for backlog lines" +msgstr "цвет отошедших ников" + +#, fuzzy +msgid "color for line ending the backlog" +msgstr "цвет ников" + msgid "" "automatically save content of buffers to files (unless a buffer disables log)" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index e0fa5e684..70387aac0 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2012-03-28 15:03+0200\n" +"POT-Creation-Date: 2012-03-28 21:44+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -5575,7 +5575,7 @@ msgid "%s: \"%s\" => level %d" msgstr "" #, c-format -msgid "===\t========== End of backlog (%d lines) ==========" +msgid "%s===\t%s========== End of backlog (%d lines) ==========" msgstr "" msgid "logger plugin configuration" @@ -5627,6 +5627,12 @@ msgid "" "= no backlog)" msgstr "" +msgid "color for backlog lines" +msgstr "" + +msgid "color for line ending the backlog" +msgstr "" + msgid "" "automatically save content of buffers to files (unless a buffer disables log)" msgstr "" diff --git a/src/plugins/logger/logger-config.c b/src/plugins/logger/logger-config.c index 1cad5fd46..e8e526f04 100644 --- a/src/plugins/logger/logger-config.c +++ b/src/plugins/logger/logger-config.c @@ -39,6 +39,11 @@ int logger_config_loading = 0; struct t_config_option *logger_config_look_backlog; +/* logger config, color section */ + +struct t_config_option *logger_config_color_backlog_line; +struct t_config_option *logger_config_color_backlog_end; + /* logger config, file section */ struct t_config_option *logger_config_file_auto_log; @@ -378,6 +383,29 @@ logger_config_init () "new buffer (0 = no backlog)"), NULL, 0, INT_MAX, "20", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + /* color */ + ptr_section = weechat_config_new_section (logger_config_file, "color", + 0, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL); + if (!ptr_section) + { + weechat_config_free (logger_config_file); + return 0; + } + + logger_config_color_backlog_line = weechat_config_new_option ( + logger_config_file, ptr_section, + "backlog_line", "color", + N_("color for backlog lines"), + NULL, -1, 0, "darkgray", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + logger_config_color_backlog_end = weechat_config_new_option ( + logger_config_file, ptr_section, + "backlog_end", "color", + N_("color for line ending the backlog"), + NULL, -1, 0, "darkgray", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + /* file */ ptr_section = weechat_config_new_section (logger_config_file, "file", 0, 0, diff --git a/src/plugins/logger/logger-config.h b/src/plugins/logger/logger-config.h index 32f0bc38d..865bf3be8 100644 --- a/src/plugins/logger/logger-config.h +++ b/src/plugins/logger/logger-config.h @@ -25,6 +25,9 @@ extern struct t_config_option *logger_config_look_backlog; +extern struct t_config_option *logger_config_color_backlog_line; +extern struct t_config_option *logger_config_color_backlog_end; + extern struct t_config_option *logger_config_file_auto_log; extern struct t_config_option *logger_config_file_name_lower_case; extern struct t_config_option *logger_config_file_path; diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c index a08c479a9..7c440e813 100644 --- a/src/plugins/logger/logger.c +++ b/src/plugins/logger/logger.c @@ -915,7 +915,7 @@ void logger_backlog (struct t_gui_buffer *buffer, const char *filename, int lines) { struct t_logger_line *last_lines, *ptr_lines; - char *pos_message, *error; + char *pos_message, *pos_tab, *error; time_t datetime, time_now; struct tm tm_line; int num_lines; @@ -947,25 +947,21 @@ logger_backlog (struct t_gui_buffer *buffer, const char *filename, int lines) datetime = mktime (&tm_line); pos_message[0] = '\t'; } - if (pos_message) - { - if (datetime != 0) - { - weechat_printf_date_tags (buffer, datetime, - "no_highlight,notify_none", - "%s", pos_message + 1); - } - else - { - weechat_printf_tags (buffer, "no_highlight,notify_none", - "%s", ptr_lines->data); - } - } - else - { - weechat_printf_tags (buffer, "no_highlight,notify_none", - "%s", ptr_lines->data); - } + pos_message = (pos_message && (datetime != 0)) ? + pos_message + 1 : ptr_lines->data; + pos_tab = strchr (pos_message, '\t'); + if (pos_tab) + pos_tab[0] = '\0'; + weechat_printf_date_tags (buffer, datetime, + "no_highlight,notify_none", + "%s%s%s%s%s", + weechat_color (weechat_config_string (logger_config_color_backlog_line)), + pos_message, + (pos_tab) ? "\t" : "", + (pos_tab) ? weechat_color (weechat_config_string (logger_config_color_backlog_line)) : "", + (pos_tab) ? pos_tab + 1 : ""); + if (pos_tab) + pos_tab[0] = '\t'; num_lines++; ptr_lines = ptr_lines->next_line; } @@ -974,7 +970,9 @@ logger_backlog (struct t_gui_buffer *buffer, const char *filename, int lines) if (num_lines > 0) { weechat_printf_tags (buffer, "no_highlight,notify_none", - _("===\t========== End of backlog (%d lines) =========="), + _("%s===\t%s========== End of backlog (%d lines) =========="), + weechat_color (weechat_config_string (logger_config_color_backlog_end)), + weechat_color (weechat_config_string (logger_config_color_backlog_end)), num_lines); weechat_buffer_set (buffer, "unread", ""); }