This crate provides a bridge between gstreamer and the tracing ecosystem.

The goal is to allow Rust applications utilizing GStreamer to better integrate into application that otherwise use the [tracing] crate for their observability needs.

Examples

Events

To output gstreamer log messages as [tracing] events, call the [integrate_events] function. Calling it before the call to any other gstreamer call (especially before the gstreamer::init) is most likely to correctly forward all of the messages:

```rust // Set up the tracing subscriber. // // e.g. tracing_subscriber::fmt::init();

tracinggstreamer::integrateevents(); gstreamer::debugremovedefaultlogfunction(); gstreamer::init(); ```

Keep in mind that both GST_DEBUG and tracing filters are in effect. The gstreamer side of filters can be relaxed from code via:

gstreamer::debug_set_default_threshold(gstreamer::DebugLevel::Count);

Similarly you can use tracing APIs to adjust the filters on the tracing side.

Spans

To provide tracing with more contextual information for some of the events, you can also enable support for generating spans via gstreamer's own tracing infrastructure.

This functionality can be enabled by calling the [integrate_spans] function. It must be called after gstreamer::init.

rust gstreamer::init(); tracing_gstreamer::integrate_spans();