Skip to main content

LogSource

Trait LogSource 

Source
pub trait LogSource {
    // Required method
    fn log_category(&self) -> &'static str;

    // Provided methods
    fn log_instance(&self) -> Option<&str> { ... }
    fn log_category_override(&self) -> Option<&str> { ... }
}
Expand description

A thing that can be logged about: its category (type) and optional instance name. Elements implement this so the logging macros pick up both from self; the runner uses Target.

Required Methods§

Source

fn log_category(&self) -> &'static str

The element type’s category, e.g. "opusenc", the filtering key.

Provided Methods§

Source

fn log_instance(&self) -> Option<&str>

The element instance name, e.g. "opusenc0", for the log line. Default none (filtering is by category regardless).

Source

fn log_category_override(&self) -> Option<&str>

A per-instance category override (M845), replacing the type category for both filtering and output, so G2G_DEBUG=my-cat:debug (and globs) key off the override. Default none: the type name is the category. An element stores one in a LogName and returns it here.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: LogSource + ?Sized> LogSource for &T

Source§

impl<T: LogSource + ?Sized> LogSource for &mut T

Implementors§