Added --gst-fatal-warnings, the same as --g-fatal-warnings

Original commit message from CVS:
Added --gst-fatal-warnings, the same as --g-fatal-warnings

It's named differently to avoid conflicting with --g-fatal-warnings, which is parsed
by gtk (which we don't depend on)
This commit is contained in:
Andy Wingo 2002-04-16 13:47:50 +00:00
parent 2eac368858
commit 057d8ccb89
2 changed files with 9 additions and 6 deletions

View file

@ -62,7 +62,8 @@ debug_log_handler (const gchar *log_domain,
}
enum {
ARG_INFO_MASK=1,
ARG_FATAL_WARNINGS=1,
ARG_INFO_MASK,
ARG_DEBUG_MASK,
ARG_MASK,
ARG_MASK_HELP,
@ -80,6 +81,7 @@ enum {
/* FIXME: put in the extended mask help */
static const struct poptOption options[] = {
{NULL, NUL, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, &init_popt_callback, 0, NULL, NULL},
{"gst-fatal-warnings", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_FATAL_WARNINGS, "Make all warnings fatal", NULL},
{"gst-info-mask", NUL, POPT_ARG_INT|POPT_ARGFLAG_STRIP, NULL, ARG_INFO_MASK, "info bitmask", "MASK"},
{"gst-debug-mask", NUL, POPT_ARG_INT|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG_MASK, "debugging bitmask", "MASK"},
{"gst-mask", NUL, POPT_ARG_INT|POPT_ARGFLAG_STRIP, NULL, ARG_MASK, "bitmask for both info and debugging", "MASK"},
@ -362,6 +364,7 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason,
const struct poptOption *option, const char *arg, void *data)
{
gint val = 0;
GLogLevelFlags fatal_mask;
switch (reason) {
case POPT_CALLBACK_REASON_PRE:
@ -369,6 +372,11 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason,
break;
case POPT_CALLBACK_REASON_OPTION:
switch (option->val) {
case ARG_FATAL_WARNINGS:
fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
g_log_set_always_fatal (fatal_mask);
break;
case ARG_INFO_MASK:
parse_number (arg, &val);
gst_info_set_categories (val);

View file

@ -76,11 +76,6 @@ _string {_char}+|("\""([^\"]|"\\\"")*"\"")
}
[[:space:]]+ { /* PRINT ("space: [%s]\n", yytext); */ }
. {
PRINT ("unknown: %s\n", yytext);
return *yytext;
}
}
{_lconnection} {