     {:ok, {captured, colors: colors}}
   end
 
+  @doc false
   def terminate(_reason, {captured, opts}) do
     :ok = add_capture(%{group_leader: nil}, opts)
 

    :ok
  end

  def handle_event({:test_started, %ExUnit.Test{} = test}, {_, opts} = state) do
    :ok = add_capture(test, opts)
    {:ok, state}

defmodule Logger.CLIFormatter do
  @moduledoc """
  An ExUnit CLI Formatter. Captures logs per test and prints as batch
  on failure.

  ## Options

  Logger.CLIFormatter supports the follow options:

    * `capture_log_blacklist` - list of backends to remove during tests

  """

  use GenEvent

  @doc false
  def init(opts) do
    colors = Keyword.put_new(opts[:colors], :enabled, IO.ANSI.enabled?)
    captured =
