     Application.start(:logger)
     Logger.configure(level: level)
 
-    on_exit(fn() ->
+    on_exit(fn ->
       Application.put_env(:logger, :handle_sasl_reports, sasl_reports?)
       Logger.App.stop()
       Application.start(:logger)

    :code.delete(WeirdFunctionNamesGenServer)
  end

  def task(parent, fun \\ (fn() -> raise "oops" end)) do
    mon = Process.monitor(parent)
    Process.unlink(parent)
    receive do
      :go ->
        fun.()
      {:DOWN, ^mon, _, _, _} ->
        exit(:shutdown)
    end
  end

  def sub_task(parent, fun \\ (fn(_) -> raise "oops" end)) do
    mon = Process.monitor(parent)
    Process.unlink(parent)
    {:ok, pid} = Task.start_link(__MODULE__, :sleep, [self()])
    receive do: (:sleeping -> :ok)
    receive do
      :go ->
        fun.(pid)
      {:DOWN, ^mon, _, _, _} ->
        exit(:shutdown)
    end

    children = [worker(WeirdFunctionNamesGenServer, [], child_opts)]
    {:ok, sup} = Supervisor.start_link(children, strategy: :simple_one_for_one)

    log =
      capture_log(:info, fn ->
        {:ok, pid} = Supervisor.start_child(sup, [])
        catch_exit(GenServer.call(pid, :error))
        [] = Supervisor.which_children(sup)
      end)

    assert log =~ ~s(Start Call: Logger.TranslatorTest.WeirdFunctionNamesGenServer."start link"/?)
  after
