def process_result(results, output_format, **kwargs):
    """Render the output into the proper format."""
    module_name = 'monitorstack.common.formatters'
    method_name = 'write_{}'.format(output_format.replace('-', '_'))
    output_formatter = getattr(
        importlib.import_module(module_name),
        method_name
    )

    # Force the output formatter into a list
    if not isinstance(results, list):  # pragma: no cover
        results = [results]

    exit_code = 0
    for result in results:
        output_formatter(result)
        if result['exit_code'] != 0:
            exit_code = result['exit_code']
    else:
        sys.exit(exit_code)