pub struct Logger { /* private fields */ }Expand description
Central logger that coordinates all logging activities
Implementationsยง
Sourceยงimpl Logger
impl Logger
pub fn new(name: String, writer: Arc<dyn LogWriter>) -> Self
Sourcepub fn console(name: String, max_level: LogLevel) -> Self
pub fn console(name: String, max_level: LogLevel) -> Self
Create a logger that outputs to the console
Sourcepub fn file(
name: String,
file_path: &Path,
max_level: LogLevel,
) -> Result<Self, Error>
pub fn file( name: String, file_path: &Path, max_level: LogLevel, ) -> Result<Self, Error>
Create a logger that outputs to a file
Sourcepub fn tracing(name: String, max_level: LogLevel) -> Self
pub fn tracing(name: String, max_level: LogLevel) -> Self
Create a logger that integrates with tracing
pub fn write_record(&self, record: LogRecord)
pub fn trace(&self, target: &str, message: &str)
pub fn debug(&self, target: &str, message: &str)
pub fn info(&self, target: &str, message: &str)
pub fn warn(&self, target: &str, message: &str)
pub fn error(&self, target: &str, message: &str)
pub fn flush(&self)
pub fn name(&self) -> &str
Trait Implementationsยง
Auto Trait Implementationsยง
impl Freeze for Logger
impl !RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl UnsafeUnpin for Logger
impl !UnwindSafe for Logger
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more