Logging Configuration

Central logging configuration for MMPP using rich formatting optimized for dark themes.

mmpp.logging_config.setup_mmpp_logging(debug=False, logger_name='mmpp', level=None, use_dark_theme=True)[source]

Set up rich logging for MMPP with dark theme optimization.

Parameters:
  • debug (bool) – Enable debug level logging

  • logger_name (str) – Name of the logger (e.g., ‘mmpp’, ‘mmpp.fft’, ‘mmpp.plotting’)

  • level (Optional[int]) – Override log level (if None, uses INFO or DEBUG based on debug flag)

  • use_dark_theme (bool) – Use colors optimized for dark backgrounds

Return type:

Logger

Returns:

Configured logger instance

mmpp.logging_config.get_mmpp_logger(name='mmpp')[source]

Get an existing MMPP logger or create a basic one if it doesn’t exist.

Parameters:

name (str) – Logger name

Return type:

Logger

Returns:

Logger instance

mmpp.logging_config.reset_logging_config()[source]

Reset logging configuration to allow reconfiguration with different settings. Useful for switching between light and dark themes.

mmpp.logging_config.configure_for_dark_theme()[source]

Convenience function to configure logging optimized for dark terminals/themes.

mmpp.logging_config.configure_for_light_theme()[source]

Convenience function to configure logging optimized for light terminals/themes.

mmpp.logging_config.get_default_logger(name='mmpp', debug=False)[source]

Get a logger with default dark theme configuration.

Parameters:
  • name (str) – Logger name

  • debug (bool) – Enable debug logging

Return type:

Logger

Returns:

Configured logger instance

Logging Functions

mmpp.logging_config.setup_mmpp_logging(debug=False, logger_name='mmpp', level=None, use_dark_theme=True)[source]

Set up rich logging for MMPP with dark theme optimization.

Parameters:
  • debug (bool) – Enable debug level logging

  • logger_name (str) – Name of the logger (e.g., ‘mmpp’, ‘mmpp.fft’, ‘mmpp.plotting’)

  • level (Optional[int]) – Override log level (if None, uses INFO or DEBUG based on debug flag)

  • use_dark_theme (bool) – Use colors optimized for dark backgrounds

Return type:

Logger

Returns:

Configured logger instance

mmpp.logging_config.get_mmpp_logger(name='mmpp')[source]

Get an existing MMPP logger or create a basic one if it doesn’t exist.

Parameters:

name (str) – Logger name

Return type:

Logger

Returns:

Logger instance

mmpp.logging_config.get_default_logger(name='mmpp', debug=False)[source]

Get a logger with default dark theme configuration.

Parameters:
  • name (str) – Logger name

  • debug (bool) – Enable debug logging

Return type:

Logger

Returns:

Configured logger instance

Usage Examples

Basic Logging Setup

from mmpp.logging_config import setup_mmpp_logging, get_mmpp_logger

# Setup logging with dark theme optimization
setup_mmpp_logging(level="INFO", dark_theme=True)

# Get logger for your module
log = get_mmpp_logger("my_module")

log.info("This is an info message")
log.warning("This is a warning")
log.error("This is an error")

Advanced Configuration

# Setup with custom formatting
setup_mmpp_logging(
    level="DEBUG",
    dark_theme=True,
    format_string="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)

# Get logger with emoji support
log = get_mmpp_logger("mmpp.analysis")
log.info("🚀 Starting analysis...")
log.success("✅ Analysis completed successfully!")