pub struct Logger { /* private fields */ }Expand description
Logger for handling output with cargo-style progress and status messages.
All progress and status messages go to stderr (matching cargo’s behavior). This allows command output (badges, changelog, etc.) to be piped cleanly through stdout while progress messages appear on the console.
Implementations§
Source§impl Logger
impl Logger
Sourcepub fn progress(&mut self, message: &str)
pub fn progress(&mut self, message: &str)
Show a progress bar (ephemeral, disappears on finish).
Use this for operations with known progress. Always uses stderr (matching cargo’s behavior).
Sourcepub fn set_progress_message(&self, message: &str)
pub fn set_progress_message(&self, message: &str)
Update the progress bar message.
Sourcepub fn status(&mut self, action: &str, target: &str)
pub fn status(&mut self, action: &str, target: &str)
Print a status message in cargo’s style: “ Building crate-name“.
Uses cyan color for the action word (ephemeral operations). This creates an ephemeral message that will be cleared on finish(). Always goes to stderr (matching cargo’s behavior).
Sourcepub fn status_permanent(&self, action: &str, target: &str)
pub fn status_permanent(&self, action: &str, target: &str)
Print a permanent status message in cargo’s style: “ Compiling crate-name“.
Uses green color for the action word (permanent operations). This message will NOT be cleared - use for operations that spawn subprocesses. Always goes to stderr (matching cargo’s behavior).
Sourcepub fn print_message(&self, msg: &str)
pub fn print_message(&self, msg: &str)
Print a permanent message (will be kept in output).
Always goes to stderr (matching cargo’s behavior).
Sourcepub fn info(&self, action: &str, target: &str)
pub fn info(&self, action: &str, target: &str)
Print an info message (cyan colored).
Info messages are permanent (not cleared). Always goes to stderr (matching cargo’s behavior).
Sourcepub fn warning(&self, action: &str, target: &str)
pub fn warning(&self, action: &str, target: &str)
Print a warning message (yellow colored).
Warning messages are permanent (not cleared). Always goes to stderr (matching cargo’s behavior).
Sourcepub fn error(&self, action: &str, target: &str)
pub fn error(&self, action: &str, target: &str)
Print an error message (red colored).
Error messages are permanent (not cleared). Always goes to stderr (matching cargo’s behavior).
Sourcepub fn clear_status(&mut self)
pub fn clear_status(&mut self)
Clear the current status message immediately.
Useful before subprocess operations that might write to stderr.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Logger
impl RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl UnwindSafe for Logger
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.