Function extism::set_log_callback

source ยท
pub fn set_log_callback<F: 'static + Clone + Fn(&str)>(
    func: F,
    filter: impl AsRef<str>
) -> Result<(), Error>
Expand description

Sets a custom callback to handle logs, each line will be passed to the provided callback instead of being logged to a file. This initializes a default tracing_subscriber and should only be called once.

filter may contain a general level like trace or error, but can also be more specific to enable logging only from specific crates. For example, to enable trace-level logging only for the extism crate use: extism=trace.