Debug implementation of gstreamer::message::Error is not very useful
Here is the current Debug
output of message::Error
:
Error(Message { ptr: 0x7fdaf400ab50, type: "error", seqnum: 380, src: Some("rtmp2sink0"), structure: Some(GstMessageError { gerror: (GError) ((GError*) 0x7fdaf4002820), debug: (gchararray) "../subprojects/gst-plugins-bad/gst/rtmp2/gstrtmp2sink.c(1117): send_connect_error (): /GstPipeline:10-destination-rtmp://amsterdamX.onestream.studio/live/live_1187894_fkxjcqbjh/GstRtmp2Sink:rtmp2sink0:\ndomain g-resolver-error-quark, code 0" }) })
It's not very useful as we don't see the actual message. It's also a bit unfortunate as errors is typically something one may want to log.
We also have this pattern in a lot of examples displaying errors.
How could we make this easier?
- Manually implement
Debug
and return adebug_struct
witherror
,debug
,details
. This would make debug output more convenient but means we'll have to manually implementDebug
for allMessageView
types as it's currently derived in the macro. - Manually implement
Display
returning something like this ? Could be more convenient as it can be logged directly.
Any other idea?
The same apply for message::Warning
and message::Info
.