[vlc-commits] logger/file: Use choice list for log-verbose option
Marvin Scholz
git at videolan.org
Fri Sep 8 17:19:28 CEST 2017
vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Fri Sep 1 23:35:41 2017 +0200| [4f555ac71fbe7f5a5d4e44ce5982dbe0f5be3014] | committer: Rémi Denis-Courmont
logger/file: Use choice list for log-verbose option
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4f555ac71fbe7f5a5d4e44ce5982dbe0f5be3014
---
modules/logger/file.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/modules/logger/file.c b/modules/logger/file.c
index dfb0113750..ff7962497b 100644
--- a/modules/logger/file.c
+++ b/modules/logger/file.c
@@ -192,6 +192,16 @@ static void Close(void *opaque)
static const char *const mode_list[] = { "text", "html" };
static const char *const mode_list_text[] = { N_("Text"), N_("HTML") };
+static const int verbosity_values[] = {
+ -1,
+ VLC_MSG_INFO,
+ VLC_MSG_ERR,
+ VLC_MSG_WARN,
+ VLC_MSG_DBG
+};
+
+static const char *const verbosity_text[] = { N_("Default"), N_("Info"), N_("Error"), N_("Warning"), N_("Debug") };
+
#define FILE_LOG_TEXT N_("Log to file")
#define FILE_LOG_LONGTEXT N_("Log all VLC messages to a text file.")
@@ -199,8 +209,8 @@ static const char *const mode_list_text[] = { N_("Text"), N_("HTML") };
#define LOGMODE_LONGTEXT N_("Specify the logging format.")
#define LOGVERBOSE_TEXT N_("Verbosity")
-#define LOGVERBOSE_LONGTEXT N_("Select the verbosity to use for log or -1 to " \
-"use the same verbosity given by --verbose.")
+#define LOGVERBOSE_LONGTEXT N_("Select the verbosity to use for log or " \
+"default to use the same verbosity given by --verbose.")
vlc_module_begin()
set_shortname(N_("Logger"))
@@ -215,6 +225,6 @@ vlc_module_begin()
N_("Log filename"), N_("Specify the log filename."), false)
add_string("logmode", "text", LOGMODE_TEXT, LOGMODE_LONGTEXT, false)
change_string_list(mode_list, mode_list_text)
- add_integer("log-verbose", -1, LOGVERBOSE_TEXT, LOGVERBOSE_LONGTEXT,
- false)
+ add_integer("log-verbose", -1, LOGVERBOSE_TEXT, LOGVERBOSE_LONGTEXT, false)
+ change_integer_list(verbosity_values, verbosity_text)
vlc_module_end ()
More information about the vlc-commits
mailing list