Returns a dictionary (should be treated as immutable) of settings needed to configure a logger.
    If PEYOTL_LOGGING_LEVEL, PEYOTL_LOGGING_FORMAT, and PEYOTL_LOG_FILE_PATH are all in the env, then
        no config file will be read.
    If PEYOTL_LOG_FILE_PATH is set to an empty string, then stderr will be used.
    Otherwise the config will be read, and any of those env vars that are present will then override
        the settings from the config file.
    Crucial keys-value pairs are:
    'level' -> logging.level as returned by _get_logging_level from the string obtained from PEYOTL_LOGGING_LEVEL
        or config.logging.level
    'formatter' -> None or a logging.Formatter as returned by _get_logging_format from the string obtained from
        PEYOTL_LOGGING_FORMAT or config.logging.formatter
    'filepath' -> None (for StreamHandler) or a filepath
    'log_dir' -> None or the parent of the 'filepath' key

    If log_init_warnings is a list, warnings pertaining reading the logging configuration will be appended to
    the list.
    This call is cached via a private global, so log_init_warnings is only used on the first call to the function.

def _read_logging_config(log_init_warnings=None):
    """Returns a dictionary (should be treated as immutable) of settings needed to configure a logger.
    If PEYOTL_LOGGING_LEVEL, PEYOTL_LOGGING_FORMAT, and PEYOTL_LOG_FILE_PATH are all in the env, then
        no config file will be read.
    If PEYOTL_LOG_FILE_PATH is set to an empty string, then stderr will be used.
    Otherwise the config will be read, and any of those env vars that are present will then override
        the settings from the config file.
    Crucial keys-value pairs are:
    'level' -> logging.level as returned by _get_logging_level from the string obtained from PEYOTL_LOGGING_LEVEL
        or config.logging.level
    'formatter' -> None or a logging.Formatter as returned by _get_logging_format from the string obtained from
        PEYOTL_LOGGING_FORMAT or config.logging.formatter
    'filepath' -> None (for StreamHandler) or a filepath
    'log_dir' -> None or the parent of the 'filepath' key

    If log_init_warnings is a list, warnings pertaining reading the logging configuration will be appended to
    the list.
    This call is cached via a private global, so log_init_warnings is only used on the first call to the function.
    """
    global _LOGGING_CONF
    from peyotl.utility.get_config import get_config_object
    if _LOGGING_CONF is not None:
        return _LOGGING_CONF
    try:
        with _LOGGING_CONF_LOCK:
            if _LOGGING_CONF is not None:
                return _LOGGING_CONF
            leco = _logging_env_conf_overrides(log_init_warnings).get('logging', {})
            lc = {}
            level_from_env = leco.get("level")
            format_from_env = leco.get("format")
            log_file_path_from_env = leco.get("filepath")
            level_enum = None
            formatter = None
            if not (level_from_env and format_from_env and log_file_path_from_env):
                # If any aspect is missing from the env, then we need to check the config file
                cfg = get_config_object()
                level = cfg.get_config_setting('logging', 'level', 'WARNING', warn_on_none_level=None)
                logging_format_name = cfg.get_config_setting('logging', 'formatter', 'NONE', warn_on_none_level=None)
                logging_filepath = cfg.get_config_setting('logging', 'filepath', '', warn_on_none_level=None)
                if logging_filepath == '':
                    logging_filepath = None
                lc['level_name'] = level
                level_enum = _get_logging_level(level, log_init_warnings)
                lc['formatter_name'] = logging_format_name
                formatter = _get_logging_formatter(logging_format_name, log_init_warnings)
                lc['filepath'] = logging_filepath
            # Override
            if level_from_env:
                lc['level_name'] = level_from_env
                level_enum = _get_logging_level(level_from_env)
            if format_from_env:
                lc['formatter_name'] = format_from_env
                formatter = _get_logging_formatter(format_from_env)
            if log_file_path_from_env is not None:
                lc['filepath'] = log_file_path_from_env
            fp = lc['filepath']
            if not fp:
                lc['filepath'] = None
            lc['log_dir'] = os.path.split(fp)[0] if fp else None
            lc['level'] = level_enum
            lc['formatter'] = formatter
            _LOGGING_CONF = lc
            return _LOGGING_CONF
    except Exception as x:
        sys.stderr.write('Exception in peyotl.utility.get_logger._read_logging_config: {}'.format(str(x)))
        raise