populse_mia.logging_config

Utilities for configuring and managing application logging.

This module provides helper functions to initialize logging, create log files, and remove old log files according to the configured retention policy.

Functions

configure_logging(log_in_stdout, ...)

Configure the application logging.

populse_mia.logging_config.configure_logging(log_in_stdout: bool, keep_log_files: int, log_level: str) None[source]

Configure the application logging.

Parameters:
  • log_in_stdout (bool) – If True, log messages are written to stdout. Otherwise, they are written to a log file.

  • keep_log_files (int) – Number of log files to retain.

  • log_level (str) – Level of the logger.

populse_mia.logging_config._cleanup_old_logs(log_dir: Path, keep_log_files: int) None[source]

Remove the oldest log files from the log directory.

Deletes log files matching mia_*.log until at most keep_log_files log files remain.

Parameters:
  • log_dir (pathlib.Path) – Directory containing the log files.

  • keep_log_files (int) – Maximum number of log files to keep.