     {ast, state}
   end
 
-  defp issues_for_call([{:<<>>, _, [_ | _]} | _] = _args, meta, {import?, issues}, issue_meta) do
-    {import?, [issue_for(issue_meta, meta[:line]) | issues]}
+  defp issues_for_call([{:<<>>, _, [_ | _]} | _] = _args, meta, {module_contains_import?, issues}, issue_meta) do
+    {module_contains_import?, [issue_for(issue_meta, meta[:line]) | issues]}
   end
   defp issues_for_call(_args, _meta, state, _issue_meta) do
     state

  @moduledoc """
  Ensures laziness of Logger calls.

  The best practice is to wrap an expensive logger calls into a zero argument function (fn -> "input" end)

  Example:

    Logger.info fn -> "expensive to calculate info" end

  Instead of:

    Logger.info "mission accomplished"
  """

  @explanation [check: @moduledoc]

  @levels [:debug, :info, :warn, :error]
  @default_params [
    levels: @levels,
  ]


  use Credo.Check, base_priority: :high

  @doc false
  def run(%SourceFile{} = source_file, params \\ []) do
    issue_meta = IssueMeta.for(source_file, params)
    state = {false, []} # Logger import seen ?, list of issues
    {_, issues} = Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta), state)
    issues
  end



  defp issue_for(issue_meta, line_no) do
    format_issue issue_meta,
      message: "Prefer lazy Logger calls.",
      line_no: line_no
  end

  defp logger_import?([{:__aliases__, _meta, [:Logger]}]), do: true
  defp logger_import?(_), do: false
end
