pub struct Log { /* private fields */ }Expand description
A logger, but more generally a store of current context (what’s going on). The context is used both for adding information to log messages and errors generated during this context.
Implementations§
source§impl Log
impl Log
sourcepub fn fork(&self, attrs: impl Fn(&mut HashMap<&'static str, String>)) -> Self
pub fn fork(&self, attrs: impl Fn(&mut HashMap<&'static str, String>)) -> Self
Create a new Log that inherits attributes from the base logging context. Use
like let new_log = log.fork(ea!(newkey = newvalue, ...));.
pub fn log( &self, l: Level, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) )
sourcepub fn debug(
&self,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
)
pub fn debug( &self, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) )
Log a message at the debug level.
sourcepub fn info(
&self,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
)
pub fn info( &self, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) )
Log a message at the info level.
sourcepub fn warn(
&self,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
)
pub fn warn( &self, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) )
Log a message at the warn level.
sourcepub fn err(
&self,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
)
pub fn err( &self, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) )
Log a message at the error level.
pub fn log_e( &self, l: Level, e: Error, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) )
sourcepub fn debug_e(
&self,
e: Error,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
)
pub fn debug_e( &self, e: Error, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) )
Log an error with an additional message at the debug level.
sourcepub fn info_e(
&self,
e: Error,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
)
pub fn info_e( &self, e: Error, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) )
Log an error with an additional message at the info level.
sourcepub fn warn_e(
&self,
e: Error,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
)
pub fn warn_e( &self, e: Error, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) )
Log an error with an additional message at the warn level.
sourcepub fn err_e(
&self,
e: Error,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
)
pub fn err_e( &self, e: Error, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) )
Log an error with an additional message at the error level.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Log
impl Send for Log
impl Sync for Log
impl Unpin for Log
impl UnwindSafe for Log
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