Skip to main content

Logger

Struct Logger 

Source
pub struct Logger { /* private fields */ }
Expand description

Logger for verbose output and observability (R7.5, NFR5)

Implementations§

Source§

impl Logger

Source

pub fn new(verbose: bool) -> Self

Create a new logger instance

Source

pub fn set_spec_id(&mut self, spec_id: String)

Set the spec_id for structured logging (FR-OBS-001)

Source

pub fn set_phase(&mut self, phase: String)

Set the phase for structured logging (FR-OBS-001)

Source

pub fn set_runner_mode(&mut self, runner_mode: String)

Set the runner mode for structured logging (FR-OBS-001)

Source

pub fn spec_id(&self) -> Option<&str>

Get the current spec_id

Source

pub fn phase(&self) -> Option<&str>

Get the current phase

Source

pub fn runner_mode(&self) -> Option<&str>

Get the current runner mode

Source

pub const fn is_verbose(&self) -> bool

Check if verbose mode is enabled

Source

pub fn verbose(&self, message: &str)

Log a message if verbose mode is enabled (FR-OBS-002, FR-OBS-003)

All messages are sanitized to remove environment variables and redact secrets.

Source

pub fn verbose_fmt(&self, args: Arguments<'_>)

Log a message with formatting if verbose mode is enabled (FR-OBS-002, FR-OBS-003)

All messages are sanitized to remove environment variables and redact secrets.

Source

pub fn info(&self, message: &str)

Log an info message with structured fields (FR-OBS-001, FR-OBS-002, FR-OBS-003)

All messages are sanitized to remove environment variables and redact secrets.

Source

pub fn warn(&self, message: &str)

Log a warning message with structured fields (FR-OBS-001, FR-OBS-002, FR-OBS-003)

All messages are sanitized to remove environment variables and redact secrets.

Source

pub fn error(&self, message: &str)

Log an error message with structured fields (FR-OBS-001, FR-OBS-002, FR-OBS-003)

All messages are sanitized to remove environment variables and redact secrets. This is critical for error messages which may contain sensitive context.

Source

pub fn start_timing(&mut self, operation: &str)

Start timing an operation

Source

pub fn end_timing(&mut self, operation: &str) -> Duration

End timing an operation and record the duration

Source

pub fn log_file_operation( &mut self, path: &str, operation: &str, size_bytes: Option<usize>, hash: Option<String>, )

Log a file operation (R7.5, NFR5)

Source

pub fn log_selected_files(&self, file_count: usize, total_bytes: usize)

Log selected files for packet construction (R7.5, NFR5)

Source

pub fn log_file_selected(&self, path: &str, bytes: usize, priority: &str)

Log individual file selection (R7.5, NFR5)

Source

pub fn log_packet_construction( &self, used_bytes: usize, used_lines: usize, max_bytes: usize, max_lines: usize, )

Log packet construction details (R7.5, NFR5)

Source

pub fn log_claude_execution(&self, model: &str, runner: &str, args: &[String])

Log Claude CLI execution details (R7.5)

Source

pub fn log_canonicalization( &self, file_type: &str, original_size: usize, canonical_size: usize, hash: &str, )

Log canonicalization details (R7.5)

Source

pub fn log_redaction_results( &self, files_scanned: usize, patterns_matched: usize, files_with_secrets: usize, )

Log secret redaction results (R7.5, NFR5 - no secrets logged)

Source

pub fn get_timing_summary(&self) -> Vec<TimingInfo>

Get timing summary for all operations

Source

pub fn get_file_operations(&self) -> &[FileOperation]

Get file operations summary

Source

pub fn total_elapsed(&self) -> Duration

Get total elapsed time since logger creation

Source

pub fn record_packetization_timing( &mut self, duration: Duration, file_count: usize, )

Record packetization timing with file count (NFR1)

Source

pub fn record_empty_run_timing(&mut self, duration: Duration)

Record empty run timing (NFR1)

Source

pub fn calculate_percentiles( &self, operation: &str, ) -> Option<TimingPercentiles>

Calculate timing percentiles for an operation

Source

pub fn generate_performance_metrics(&mut self) -> PerformanceMetrics

Generate comprehensive performance metrics (NFR1)

Source

pub fn validate_performance_targets(&self) -> Vec<String>

Validate performance against targets (NFR1)

Source

pub fn log_cache_stats(&self, stats: &CacheStats)

Log cache statistics (wires cache stats into logging)

Source

pub fn print_performance_summary(&self)

Print performance summary if verbose

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more