def METHOD_NAME(ctx, gi, history_id):
    """Summarize a history with print() based on similar code in Galaxy for populators."""
    if not ctx.verbose:
        return
    if history_id is None:
        raise ValueError("summarize_history passed empty history_id")
    try:
        history_contents = gi.histories.show_history(history_id, contents=True)
    except Exception:
        print("Failed to fetch history contents in summarize_history.")
        return
    for history_content in history_contents:
        history_content_id = history_content.get("id", None)
        print("| %d - %s (HID - NAME) " % (int(history_content["hid"]), history_content["name"]))
        if history_content["history_content_type"] == "dataset_collection":
            history_contents_json = gi.histories.show_dataset_collection(history_id, history_content["id"])
            print("| Dataset Collection: %s" % history_contents_json)
            continue
        try:
            dataset_info = gi.histories.show_dataset(history_id, history_content_id)
            print("| Dataset State:")
            print(_format_for_summary(dataset_info.get("state"), "Dataset state is unknown."))
            print("| Dataset Blurb:")
            print(_format_for_summary(dataset_info.get("misc_blurb", ""), "Dataset blurb was empty."))
            print("| Dataset Info:")
            print(_format_for_summary(dataset_info.get("misc_info", ""), "Dataset info is empty."))
            print("| Peek:")
            print(_format_for_summary(dataset_info.get("peek", ""), "Peek unavailable."))
        except Exception:
            print("| *PLANEMO ERROR FETCHING DATASET DETAILS*")
        try:
            provenance_info = _dataset_provenance(gi, history_id, history_content_id)
            print("| Dataset Job Standard Output:")
            print(_format_for_summary(provenance_info.get("stdout", ""), "Standard output was empty."))
            print("| Dataset Job Standard Error:")
            print(_format_for_summary(provenance_info.get("stderr", ""), "Standard error was empty."))
        except Exception:
            print("| *PLANEMO ERROR FETCHING JOB DETAILS*")
        print("|")