Debugging/Logging

Jan Alexander Steffens jan.steffens at gmail.com
Mon Jun 26 07:08:38 UTC 2017


On Mon, Jun 26, 2017 at 8:59 AM Mats Lindestam <mats.lindestam at gmail.com>
wrote:

> I have an element (bin) that has defined its own GstDebugCategory. What I
> did was to break out some of the element-functions to another utility-file.
> This was done to facilitate stubbing when running check-tests.
>
> A drawback of this is that Gstreamer logging functions e.g. GST_DEBUG (),
> GST_INFO (), GST_ELEMENT_ERROR(),... does not seem to work in the
> utility-file.
>
> Is there a way around this, so that the utility-file can use the debug
> category of the element?
>

If you want to share a debug category across more than one compilation
unit, instead of using GST_DEBUG_CATEGORY_STATIC, define the category using
GST_DEBUG_CATEGORY in one compilation unit and reference it using
GST_DEBUG_CATEGORY_EXTERN in the other units (e.g. via the element's header
file).

You still need to define GST_CAT_DEFAULT in all compilation units.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170626/b4f8c92e/attachment.html>


More information about the gstreamer-devel mailing list