import logging
import yaml


def process_yaml(filepath):
    """Process yaml at filepath and return an object.

    Args:
      filepath: str, file path for the YAML file.

    Returns:
      object, yaml data as dict.
    """
    logging.info('Processing yaml file: %s', filepath)
    data = {}
    try:
        with open(filepath, 'r') as cfile:
            data = yaml.load(cfile.read(), Loader=yaml.SafeLoader)
    except FileNotFoundError:
        logging.error('No file exists at path: %s', filepath)
    return data