def get_parser_from_config(base_config, attributes, default_parser):
    """
    Checks the various places that the parser option could be set and returns
    the value with the highest precedence, or `default_parser` if no parser was found
    @param base_config: a set of log config options for a logfile
    @param attributes: a set of attributes to apply to a logfile
    @param default_parser: the default parser if no parser setting is found in base_config or attributes
    """
    if 'attributes' in base_config and 'parser' in base_config['attributes']:
        return base_config['attributes']['parser']
    if 'parser' in base_config:
        return base_config['parser']
    if 'parser' in attributes:
        return attributes['parser']
    return default_parser
