Struct r3bl_simple_logger::TestLogger
source · pub struct TestLogger { /* private fields */ }
Expand description
The TestLogger struct. Provides a very basic Logger implementation that may be captured by cargo.
Implementations§
source§impl TestLogger
impl TestLogger
sourcepub fn init(
log_level: LevelFilter,
config: Config
) -> Result<(), SetLoggerError>
pub fn init( log_level: LevelFilter, config: Config ) -> Result<(), SetLoggerError>
init function. Globally initializes the TestLogger as the one and only used log facility.
Takes the desired Level
and Config
as arguments. They cannot be changed later on.
Fails if another Logger was already initialized.
Examples
// another logger
let _ = TestLogger::init(LevelFilter::Info, Config::default());
sourcepub fn new(log_level: LevelFilter, config: Config) -> Box<TestLogger>
pub fn new(log_level: LevelFilter, config: Config) -> Box<TestLogger>
allows to create a new logger, that can be independently used, no matter what is globally set.
no macros are provided for this case and you probably
dont want to use this function, but init()
, if you dont want to build a CombinedLogger
.
Takes the desired Level
and Config
as arguments. They cannot be changed later on.
Examples
// another logger
let test_logger = TestLogger::new(LevelFilter::Info, Config::default());
Trait Implementations§
source§impl Log for TestLogger
impl Log for TestLogger
Auto Trait Implementations§
impl RefUnwindSafe for TestLogger
impl Send for TestLogger
impl Sync for TestLogger
impl Unpin for TestLogger
impl UnwindSafe for TestLogger
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