setup_logging

setup_logging(logs_subdirectory: str) tuple[str, FileHandler][source]

Configure the logging system to write to a timestamped file. Creates the log directory if needed, resets existing handlers, and suppresses verbose logs from external libraries (urllib3, telegram, etc.).

Parameters:

logs_subdirectory (str) – The name of the subdirectory in the system folder where logs should be stored.

Returns:

A tuple containing the log filename and

the created FileHandler instance.

Return type:

tuple[str, logging.FileHandler]