pub struct ErrorLogger { /* private fields */ }Expand description
Unified error logger that handles console output and file logging
Implementations§
Source§impl ErrorLogger
impl ErrorLogger
Sourcepub fn new(options: SyncOptions, source: &Path, destination: &Path) -> Self
pub fn new(options: SyncOptions, source: &Path, destination: &Path) -> Self
Create a new error logger
Sourcepub fn get_handle(&self) -> ErrorLogHandle
pub fn get_handle(&self) -> ErrorLogHandle
Get a handle for error logging that can be cloned and shared
Sourcepub fn log_error(&self, path: &Path, message: &str, operation: &str)
pub fn log_error(&self, path: &Path, message: &str, operation: &str)
Log an error (saves to file and optionally prints to console)
Sourcepub fn log_warning(&self, path: &Path, message: &str, operation: &str)
pub fn log_warning(&self, path: &Path, message: &str, operation: &str)
Log a warning (saves to file and optionally prints to console)
Sourcepub fn log_success(&self, path: &Path, operation: &str)
pub fn log_success(&self, path: &Path, operation: &str)
Log a successful operation (only shown with -vv)
Sourcepub fn log_operation(&self, message: &str)
pub fn log_operation(&self, message: &str)
Log any operation (for -vv mode)
Sourcepub fn should_show_progress(&self) -> bool
pub fn should_show_progress(&self) -> bool
Should we display progress bars?
Sourcepub fn finalize_with_stats(&self, stats: &SyncStats) -> Result<Option<PathBuf>>
pub fn finalize_with_stats(&self, stats: &SyncStats) -> Result<Option<PathBuf>>
Write the error report file with details from SyncStats
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Get error count
Sourcepub fn warning_count(&self) -> usize
pub fn warning_count(&self) -> usize
Get warning count
Auto Trait Implementations§
impl Freeze for ErrorLogger
impl RefUnwindSafe for ErrorLogger
impl Send for ErrorLogger
impl Sync for ErrorLogger
impl Unpin for ErrorLogger
impl UnsafeUnpin for ErrorLogger
impl UnwindSafe for ErrorLogger
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> 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