def get_log_format_types():
    '''
    Get all available log format names and ids.

    :return: A dictionary of the log format names and ids.
    :rtype: dict

    CLI Example:

    .. code-block:: bash

        salt '*' win_smtp_server.get_log_format_types
    '''
    ret = dict()
    prefix = 'logging/'

    with salt.utils.winapi.Com():
        try:
            connection = wmi.WMI(namespace=_WMI_NAMESPACE)
            objs = connection.IISLogModuleSetting()

            # Remove the prefix from the name.
            for obj in objs:
                name = str(obj.Name).replace(prefix, '', 1)
                ret[name] = str(obj.LogModuleId)
        except wmi.x_wmi as error:
            _LOG.error('Encountered WMI error: %s', error.com_error)
        except (AttributeError, __HOLE__) as error:
            _LOG.error('Error getting IISLogModuleSetting: %s', error)

    if not ret:
        _LOG.error('Unable to get log format types.')
    return ret
dataset/ETHPy150Open saltstack/salt/salt/modules/win_smtp_server.py/get_log_format_types