Skip to main content

Logger

Trait Logger 

Source
pub trait Logger:
    Send
    + Sync
    + 'static {
    // Required method
    fn log(&self, level: Level, scope: &str, message: &str);
}
Expand description

Callback type for logging.

When installed, internal library log messages are delivered through this callback instead of being discarded. The embedder is responsible for formatting and routing log output.

When the log is unscoped (default scope), scope has zero length.

The callback must be safe to call from any thread.

See set_logger for more details.

Required Methods§

Source

fn log(&self, level: Level, scope: &str, message: &str)

Log a message with the given level and scope.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Logger for LogStderr

Source§

impl<L: Log + 'static> Logger for L

Available on crate feature log only.

Adapt a log implementation to be used by libghostty.

libghostty log scopes are translated directly to log’s metadata target, and log implementation can choose to filter specific libghostty logs to be emitted.