Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Thibault Saunier
gst-devtools
Commits
ae3a45d1
Commit
ae3a45d1
authored
Jun 16, 2020
by
Thibault Saunier
🌵
Committed by
GStreamer Marge Bot
Jun 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validate: Print errors on action failures
Part-of: <
gstreamer/gst-devtools!207
>
parent
7003d692
Pipeline
#165509
passed with stages
in 48 minutes and 25 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
validate/gst/validate/gst-validate-reporter.c
validate/gst/validate/gst-validate-reporter.c
+27
-1
No files found.
validate/gst/validate/gst-validate-reporter.c
View file @
ae3a45d1
...
...
@@ -30,6 +30,7 @@
# include "config.h"
#endif
#include <stdio.h>
#include <math.h>
#include "gst-validate-internal.h"
#include "gst-validate-reporter.h"
...
...
@@ -344,7 +345,7 @@ gst_validate_report_action (GstValidateReporter * reporter,
GstValidateAction
*
action
,
GstValidateIssueId
issue_id
,
const
gchar
*
format
,
...)
{
va_list
var_args
;
va_list
var_args
,
var_copy
;
GString
*
f
;
if
(
!
action
)
{
...
...
@@ -372,8 +373,33 @@ gst_validate_report_action (GstValidateReporter * reporter,
done:
va_start
(
var_args
,
format
);
G_VA_COPY
(
var_copy
,
var_args
);
gst_validate_report_valist
(
reporter
,
issue_id
,
f
->
str
,
var_args
);
if
(
action
)
{
gint
i
,
indent
=
gst_validate_action_get_level
(
action
)
*
2
;
gchar
*
message
,
**
lines
,
*
color
=
NULL
;
const
gchar
*
endcolor
=
""
;
#if GLIB_CHECK_VERSION(2,50,0)
if
(
g_log_writer_supports_color
(
fileno
(
stderr
)))
{
color
=
gst_debug_construct_term_color
(
GST_DEBUG_FG_RED
);
endcolor
=
"
\033
[0m"
;
}
#endif
gst_validate_printf
(
NULL
,
"%*s%s> Error%s:
\n
"
,
indent
,
""
,
color
?
color
:
""
,
endcolor
);
message
=
gst_info_strdup_vprintf
(
f
->
str
,
var_copy
);
lines
=
g_strsplit
(
message
,
"
\n
"
,
-
1
);
for
(
i
=
1
;
lines
[
i
];
i
++
)
gst_validate_printf
(
NULL
,
"%*s%s>%s %s
\n
"
,
indent
,
""
,
color
,
endcolor
,
lines
[
i
]);
g_strfreev
(
lines
);
g_free
(
message
);
g_free
(
color
);
}
va_end
(
var_args
);
va_end
(
var_copy
);
g_string_free
(
f
,
TRUE
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment