Module logging

Module logging 

Source
Expand description

Enhanced logging system for light-program-test

This module provides Solana Explorer-like transaction logging with:

  • Hierarchical instruction display with inner instructions
  • Account changes tracking
  • Light Protocol specific parsing and formatting
  • Configurable verbosity levels
  • Color-coded output

Logging behavior:

  • File logging: Always enabled when enhanced_logging.enabled = true (default)
  • Log file: Written to target/light_program_test.log
  • Console output: Only when RUST_BACKTRACE is set AND log_events = true
  • Log file is overwritten at session start, then appended for each transaction

Re-exports§

pub use config::EnhancedLoggingConfig;
pub use config::LogVerbosity;
pub use formatter::TransactionFormatter;
pub use types::AccountChange;
pub use types::EnhancedInstructionLog;
pub use types::EnhancedTransactionLog;
pub use types::ParsedInstructionData;
pub use types::TransactionStatus;

Modules§

config
Configuration types for enhanced logging
decoder
Instruction decoder for Light Protocol and common Solana programs
formatter
Transaction formatting utilities for explorer-style output
types
Type definitions for enhanced logging

Functions§

log_transaction_enhanced
Main entry point for enhanced transaction logging
log_transaction_enhanced_with_console
Enhanced transaction logging with console output control
should_use_enhanced_logging
Check if enhanced logging should be used instead of basic logging