pub struct TestLoggerBuilder { /* private fields */ }Expand description
Builder for creating a TestLogger with custom configuration
Implementations§
Source§impl TestLoggerBuilder
impl TestLoggerBuilder
Sourcepub fn new(test_name: &str) -> Self
pub fn new(test_name: &str) -> Self
Create a new builder for the given test name.
By default, logs are written under the active Cargo target directory as
JSONL (one JSON object per line). This honors CARGO_TARGET_DIR first
so tests do not silently write artifacts to a different filesystem than
the current build.
Sourcepub fn print_realtime(self, enabled: bool) -> Self
pub fn print_realtime(self, enabled: bool) -> Self
Enable or disable real-time printing
Sourcepub fn use_colors(self, enabled: bool) -> Self
pub fn use_colors(self, enabled: bool) -> Self
Enable or disable ANSI colors
Sourcepub fn max_entries(self, max: usize) -> Self
pub fn max_entries(self, max: usize) -> Self
Set the maximum number of entries to keep in memory
Sourcepub fn log_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn log_dir(self, dir: impl Into<PathBuf>) -> Self
Set the log directory for file persistence
Sourcepub fn build(self) -> TestLogger
pub fn build(self) -> TestLogger
Build the TestLogger
Auto Trait Implementations§
impl Freeze for TestLoggerBuilder
impl RefUnwindSafe for TestLoggerBuilder
impl Send for TestLoggerBuilder
impl Sync for TestLoggerBuilder
impl Unpin for TestLoggerBuilder
impl UnsafeUnpin for TestLoggerBuilder
impl UnwindSafe for TestLoggerBuilder
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