pub struct Logger { /* private fields */ }Expand description
Logger for verbose output and observability (R7.5, NFR5)
Implementations§
Source§impl Logger
impl Logger
Sourcepub fn set_spec_id(&mut self, spec_id: String)
pub fn set_spec_id(&mut self, spec_id: String)
Set the spec_id for structured logging (FR-OBS-001)
Sourcepub fn set_runner_mode(&mut self, runner_mode: String)
pub fn set_runner_mode(&mut self, runner_mode: String)
Set the runner mode for structured logging (FR-OBS-001)
Sourcepub fn runner_mode(&self) -> Option<&str>
pub fn runner_mode(&self) -> Option<&str>
Get the current runner mode
Sourcepub const fn is_verbose(&self) -> bool
pub const fn is_verbose(&self) -> bool
Check if verbose mode is enabled
Sourcepub fn verbose(&self, message: &str)
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.
Sourcepub fn verbose_fmt(&self, args: Arguments<'_>)
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.
Sourcepub fn info(&self, message: &str)
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.
Sourcepub fn warn(&self, message: &str)
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.
Sourcepub fn error(&self, message: &str)
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.
Sourcepub fn start_timing(&mut self, operation: &str)
pub fn start_timing(&mut self, operation: &str)
Start timing an operation
Sourcepub fn end_timing(&mut self, operation: &str) -> Duration
pub fn end_timing(&mut self, operation: &str) -> Duration
End timing an operation and record the duration
Sourcepub fn log_file_operation(
&mut self,
path: &str,
operation: &str,
size_bytes: Option<usize>,
hash: Option<String>,
)
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)
Sourcepub fn log_selected_files(&self, file_count: usize, total_bytes: usize)
pub fn log_selected_files(&self, file_count: usize, total_bytes: usize)
Log selected files for packet construction (R7.5, NFR5)
Sourcepub fn log_file_selected(&self, path: &str, bytes: usize, priority: &str)
pub fn log_file_selected(&self, path: &str, bytes: usize, priority: &str)
Log individual file selection (R7.5, NFR5)
Sourcepub fn log_packet_construction(
&self,
used_bytes: usize,
used_lines: usize,
max_bytes: usize,
max_lines: usize,
)
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)
Sourcepub fn log_claude_execution(&self, model: &str, runner: &str, args: &[String])
pub fn log_claude_execution(&self, model: &str, runner: &str, args: &[String])
Log Claude CLI execution details (R7.5)
Sourcepub fn log_canonicalization(
&self,
file_type: &str,
original_size: usize,
canonical_size: usize,
hash: &str,
)
pub fn log_canonicalization( &self, file_type: &str, original_size: usize, canonical_size: usize, hash: &str, )
Log canonicalization details (R7.5)
Sourcepub fn log_redaction_results(
&self,
files_scanned: usize,
patterns_matched: usize,
files_with_secrets: usize,
)
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)
Sourcepub fn get_timing_summary(&self) -> Vec<TimingInfo>
pub fn get_timing_summary(&self) -> Vec<TimingInfo>
Get timing summary for all operations
Sourcepub fn get_file_operations(&self) -> &[FileOperation]
pub fn get_file_operations(&self) -> &[FileOperation]
Get file operations summary
Sourcepub fn total_elapsed(&self) -> Duration
pub fn total_elapsed(&self) -> Duration
Get total elapsed time since logger creation
Sourcepub fn record_packetization_timing(
&mut self,
duration: Duration,
file_count: usize,
)
pub fn record_packetization_timing( &mut self, duration: Duration, file_count: usize, )
Record packetization timing with file count (NFR1)
Sourcepub fn record_empty_run_timing(&mut self, duration: Duration)
pub fn record_empty_run_timing(&mut self, duration: Duration)
Record empty run timing (NFR1)
Sourcepub fn calculate_percentiles(
&self,
operation: &str,
) -> Option<TimingPercentiles>
pub fn calculate_percentiles( &self, operation: &str, ) -> Option<TimingPercentiles>
Calculate timing percentiles for an operation
Sourcepub fn generate_performance_metrics(&mut self) -> PerformanceMetrics
pub fn generate_performance_metrics(&mut self) -> PerformanceMetrics
Generate comprehensive performance metrics (NFR1)
Sourcepub fn validate_performance_targets(&self) -> Vec<String>
pub fn validate_performance_targets(&self) -> Vec<String>
Validate performance against targets (NFR1)
Sourcepub fn log_cache_stats(&self, stats: &CacheStats)
pub fn log_cache_stats(&self, stats: &CacheStats)
Log cache statistics (wires cache stats into logging)
Sourcepub fn print_performance_summary(&self)
pub fn print_performance_summary(&self)
Print performance summary if verbose