mdse.logging

Logging configuration for the MDSE package.

This module provides a centralized function, setup_logging, to configure the application’s root logger. It standardizes logging across the application by setting up handlers for both console output and file-based logging, ensuring consistent formatting and behavior.

Functions

setup_logging([debug])

Configure the root logger for the application.

mdse.logging.setup_logging(debug=False)

Configure the root logger for the application.

This function sets up two handlers for the root logger: 1. A stream handler that prints logs to standard output. 2. A file handler that saves logs to a timestamped file in the logs/ directory (e.g., logs/simulation_20250101_120000.log).

The logging level is set to logging.DEBUG if the debug flag is True, otherwise it defaults to logging.INFO.

Parameters:

debug (bool, optional) – If True, set the logging level to DEBUG. Otherwise, set it to INFO. Defaults to False.