pub struct PlainLogger { /* private fields */ }Expand description
Simple logging output for CI/non-interactive mode
This provides a line-by-line output of build progress suitable for log files and CI systems that don’t support interactive terminals.
§Example
use zlayer_builder::tui::{PlainLogger, BuildEvent};
let logger = PlainLogger::new(false); // quiet mode
logger.handle_event(&BuildEvent::StageStarted {
index: 0,
name: Some("builder".to_string()),
base_image: "node:20-alpine".to_string(),
});
// Output: ==> Stage: builder (node:20-alpine)
logger.handle_event(&BuildEvent::InstructionStarted {
stage: 0,
index: 0,
instruction: "RUN npm ci".to_string(),
});
// Output: -> RUN npm ciImplementations§
Source§impl PlainLogger
impl PlainLogger
Sourcepub fn new(verbose: bool) -> Self
pub fn new(verbose: bool) -> Self
Create a new plain logger
§Arguments
verbose- If true, shows all output lines. If false, only shows stage and instruction transitions.
Sourcepub fn with_color(verbose: bool, color: bool) -> Self
pub fn with_color(verbose: bool, color: bool) -> Self
Create a new plain logger with explicit color setting
Sourcepub fn handle_event(&self, event: &BuildEvent)
pub fn handle_event(&self, event: &BuildEvent)
Handle a build event and print appropriate output
Sourcepub fn process_events<I>(&self, events: I)where
I: IntoIterator<Item = BuildEvent>,
pub fn process_events<I>(&self, events: I)where
I: IntoIterator<Item = BuildEvent>,
Process a stream of events, printing each one
This is useful for processing events from a channel in a loop.
Trait Implementations§
Source§impl Clone for PlainLogger
impl Clone for PlainLogger
Source§fn clone(&self) -> PlainLogger
fn clone(&self) -> PlainLogger
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlainLogger
impl Debug for PlainLogger
Auto Trait Implementations§
impl Freeze for PlainLogger
impl RefUnwindSafe for PlainLogger
impl Send for PlainLogger
impl Sync for PlainLogger
impl Unpin for PlainLogger
impl UnsafeUnpin for PlainLogger
impl UnwindSafe for PlainLogger
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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