pub struct TestConsoleAppender { /* private fields */ }Expand description
An appender that uses print! internally. This is less performant than
a normal ConsoleAppender, but ensures output gets captured by the
standard test harness.
Implementations§
Source§impl TestConsoleAppender
impl TestConsoleAppender
Sourcepub fn new(encoder: Box<dyn Encode>) -> Self
pub fn new(encoder: Box<dyn Encode>) -> Self
Create a new TestConsoleAppender with the given encoder.
Sourcepub fn make_config<'a, 'b>(
targets: impl IntoIterator<Item = &'a str>,
level: impl Into<Option<LevelFilter>>,
pattern: impl Into<Option<&'b str>>,
) -> Config
pub fn make_config<'a, 'b>( targets: impl IntoIterator<Item = &'a str>, level: impl Into<Option<LevelFilter>>, pattern: impl Into<Option<&'b str>>, ) -> Config
Construct a sensible Config using a TestConsoleAppender and PatternEncoder.
If targets is empty, the root logger will be enabled at the given level.
If targets is non-empty, the root logger will be disabled and all the
given targets enabled at the given level.
Defaults:
level = LevelFilter::Tracepattern = "{l} {M}::{L} {m}{n}"
Duplicate entries in targets are not allowed and will panic.
Trait Implementations§
Source§impl Append for TestConsoleAppender
impl Append for TestConsoleAppender
Auto Trait Implementations§
impl Freeze for TestConsoleAppender
impl !RefUnwindSafe for TestConsoleAppender
impl Send for TestConsoleAppender
impl Sync for TestConsoleAppender
impl Unpin for TestConsoleAppender
impl UnsafeUnpin for TestConsoleAppender
impl !UnwindSafe for TestConsoleAppender
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