pub struct SatLogger { /* private fields */ }Expand description
The main logger struct
Implementations§
Source§impl SatLogger
impl SatLogger
Sourcepub fn init(level: LevelFilter) -> Result<(), SetLoggerError>
pub fn init(level: LevelFilter) -> Result<(), SetLoggerError>
Initializes and sets up a new SatLogger instance.
§Arguments
level: Maximum level of messages to display. Any message with this or below level will be ignored.
§Example
use satlog::SatLogger;
use log::LevelFilter;
fn main() {
SatLogger::init(LevelFilter::Info);
log::info!("Hello");
log::trace!("Will not display");
}Examples found in repository?
examples/simple.rs (line 4)
3fn main() {
4 SatLogger::init(LevelFilter::Info).expect("Could not create logger");
5
6 log::debug!("NOT SHOWN");
7 log::trace!("NOT SHOWN");
8 log::info!("SHOWN WITHOUT LEVEL");
9 log::warn!("SHOWN");
10 log::error!("SHOWN");
11
12 log::info!("Multiline:\nFirst\nSecond\nThird");
13 log::error!("Multiline:\nFirst\nSecond\nThird");
14}Trait Implementations§
Auto Trait Implementations§
impl Freeze for SatLogger
impl RefUnwindSafe for SatLogger
impl Send for SatLogger
impl Sync for SatLogger
impl Unpin for SatLogger
impl UnwindSafe for SatLogger
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