pub trait Logger: Clone + Debug {
// Required method
fn write(&self, msg: String);
// Provided methods
fn info(&self, msg: impl AsRef<str>, context: Option<&Context>) { ... }
fn warn(&self, msg: impl AsRef<str>, context: Option<&Context>) { ... }
fn error(&self, msg: impl AsRef<str>, context: Option<&Context>) { ... }
fn format_log(
&self,
msg: impl AsRef<str>,
level: &str,
context: Option<&Context>,
) -> String { ... }
}Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl Logger for DefaultLogger
By default, print to stderr.