mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
qa-report: add a timestamp to error reports
This commit is contained in:
parent
3476fffd54
commit
0bc7ae9aeb
2 changed files with 12 additions and 2 deletions
|
@ -51,6 +51,7 @@ gst_qa_error_report_new (GstObject * source, GstQaErrorArea area,
|
|||
report->area = area;
|
||||
report->message = g_strdup (message);
|
||||
report->detail = g_strdup (detail);
|
||||
report->timestamp = g_date_time_new_now_local ();
|
||||
|
||||
return report;
|
||||
}
|
||||
|
@ -61,6 +62,7 @@ gst_qa_error_report_free (GstQaErrorReport * report)
|
|||
g_free (report->message);
|
||||
g_free (report->detail);
|
||||
g_object_unref (report->source);
|
||||
g_date_time_unref (report->timestamp);
|
||||
g_slice_free (GstQaErrorReport, report);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,13 +38,21 @@ typedef struct {
|
|||
GstQaErrorArea area;
|
||||
gchar *message;
|
||||
gchar *detail;
|
||||
GDateTime *timestamp;
|
||||
|
||||
GstObject *source;
|
||||
} GstQaErrorReport;
|
||||
|
||||
#define GST_QA_ERROR_REPORT_PRINT_FORMAT "%d - %s - %s) %s (%s)"
|
||||
#define GST_QA_REPORT_PRINT_ARGS(r) r->area, gst_qa_error_area_get_name(r->area), \
|
||||
#define GST_QA_ERROR_REPORT_PRINT_FORMAT "%04d-%02d-%02dT%02d:%02d:%02d.%06d: %s, %s(%d)) %s (%s)"
|
||||
#define GST_QA_REPORT_PRINT_ARGS(r) g_date_time_get_year (r->timestamp), \
|
||||
g_date_time_get_month (r->timestamp), \
|
||||
g_date_time_get_day_of_month (r->timestamp), \
|
||||
g_date_time_get_hour (r->timestamp), \
|
||||
g_date_time_get_minute (r->timestamp), \
|
||||
g_date_time_get_second (r->timestamp), \
|
||||
g_date_time_get_microsecond (r->timestamp), \
|
||||
r->source ? GST_OBJECT_NAME(r->source) : "null", \
|
||||
gst_qa_error_area_get_name(r->area), r->area, \
|
||||
r->message, r->detail
|
||||
|
||||
GstQaErrorReport * gst_qa_error_report_new (GstObject * source, GstQaErrorArea area, const gchar * message, const gchar * detail);
|
||||
|
|
Loading…
Reference in a new issue