logging.configure_logger#

autoclean.utils.logging.configure_logger(verbose=None, output_dir=None, task=None)[source]#

Configure the logger based on verbosity level and output directory.

Parameters:
verbosebool, str, int, LogLevel, optional

Controls logging verbosity. Can be:

  • bool: True is the same as ‘INFO’, False is the same as ‘WARNING’

  • str: One of ‘DEBUG’, ‘INFO’, ‘HEADER’, WARNING’, ‘ERROR’, or ‘CRITICAL’

  • int: Standard Python logging level (10=DEBUG, 20=INFO, etc.)

  • LogLevel enum: Direct log level specification

  • None: Reads MNE_LOGGING_LEVEL environment variable, defaults to INFO

output_dirstr or Path, optional

Directory where task outputs will be stored

taskstr, optional

Name of the current task. If provided, logs will be stored in task’s debug directory

Returns:
str

Appropriate MNE verbosity level (‘DEBUG’, ‘INFO’, ‘WARNING’, ‘ERROR’, or ‘CRITICAL’)