pub struct BenchLogger { /* private fields */ }Expand description
Benchmark logger that writes timestamped lines to stderr and optionally to a log file (tee behavior).
§Validation
- VAL-INFRA-014: Timestamped logging
[YYYY-MM-DD HH:MM:SS]prefix, supports stderr + file output (tee behavior)
Implementations§
Source§impl BenchLogger
impl BenchLogger
Sourcepub fn with_file<P: AsRef<Path>>(path: P) -> Self
pub fn with_file<P: AsRef<Path>>(path: P) -> Self
Create a new logger that also writes to the given file path.
The file is opened in append mode; if it doesn’t exist, it is created.
Sourcepub fn set_log_file<P: AsRef<Path>>(&mut self, path: P)
pub fn set_log_file<P: AsRef<Path>>(&mut self, path: P)
Set the log file path (replaces any existing one).
Sourcepub fn clear_log_file(&mut self)
pub fn clear_log_file(&mut self)
Clear the log file (stderr-only mode).
Sourcepub fn log_file_path(&self) -> Option<&Path>
pub fn log_file_path(&self) -> Option<&Path>
Get the log file path, if set.
Trait Implementations§
Source§impl Debug for BenchLogger
impl Debug for BenchLogger
Auto Trait Implementations§
impl Freeze for BenchLogger
impl RefUnwindSafe for BenchLogger
impl Send for BenchLogger
impl Sync for BenchLogger
impl Unpin for BenchLogger
impl UnsafeUnpin for BenchLogger
impl UnwindSafe for BenchLogger
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more