def get_credentials(args, logger):
    """Parses the credentials yaml file and gets user and token (simple yaml parser, key-value parser).

    Parameters:
        args: Object with command line arguments (credentials file)
        logger: Function used for logging
    
    Returns:
        Credentials, user and token.
    """

    data = {}

    with open(args.credentials_file, 'r') as credentials_file:
        logger('Reading the credentials file')

        # parse line by line
        for line in credentials_file.readlines():

            # ignore comments
            if line.startswith('#'):
                continue

            # split the line and take the key and value
            values = line.split(':')
            key = values[0].strip()
            value = values[1].strip()
            data[key] = value
    
    if not 'user' in data:
        raise Exception('There is no user found in the credentials file')

    if not 'token' in data:
        raise Exception('There is no token found in the credentials file')
        
    logger('The credentials are read successfully')
        
    return data