from typing import Union
from pathlib import Path
import ast


def get_logging_config(cfg_file: Union[str, Path]) -> dict:
    """Get the loggging config dictionary from file.

    Parameters
    ----------
    cfg_file : `Union[str, Path]`
        The logging config file.

    Returns
    -------
    `dict`
        The dictionary for the input of dictConfig()
    """
    with open(cfg_file, 'r') as f:
        ret = f.read()
        logging_config = ast.literal_eval(ret)
    
    return logging_config