[vlc-devel] [PATCH] logger/file: Use choice list for log-verbose option
Marvin Scholz
epirat07 at gmail.com
Fri Sep 1 16:42:13 CEST 2017
---
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..eab7d5f654 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 ()
--
2.11.0 (Apple Git-81)
More information about the vlc-devel
mailing list