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§
Implementors§
impl Logger for DefaultLogger
By default, print to stderr
.