anchor.diff:  -spec log_stanza(undefined | binary(), in | out, exml_stream:element()) -> ok.
   log_stanza(undefined, _, _) -> ok;
   log_stanza(Jid, Direction, Stanza) ->
  -    case is_ct_available() andalso ct:get_config(stanza_log) of
  -        true ->
  -            do_log_stanza(Jid, Direction, Stanza);
  +    case {is_ct_available(), ct:get_config(stanza_log)} of
  +        {true, true} ->
  +            do_log_stanza(console_and_file, Jid, Direction, Stanza);
  +        {true, LogTarget}
  +          when console_and_file == LogTarget;
  +               console == LogTarget;
  +               file == LogTarget ->
  +            do_log_stanza(LogTarget, Jid, Direction, Stanza);
           _ ->
               ok
       end.
  
positive.code:                        [ReportString, Stanza]),
                  ct:fail(Error)
          end,
      ct:pal(stanza_log, "~s~n~s", [ReportString, PrettyStanza]).
  
  %% ------------- Common Test hack! -------------
  %% There is a bug in Common Test since 18.3, which causes links to be printed inside <pre/>.
  
negative.code: is_ct_available() ->
      code:is_loaded(ct) =/= false andalso ct:get_status() =/= no_tests_running.
  
  -spec do_log_stanza(Target, Jid, Direction, Stanza) -> ok when
        Target :: console_and_file | console | file,
        Jid :: binary(),
        Direction :: in | out,
        Stanza :: exml:element().
  do_log_stanza(Target, Jid, Direction, Stanza) ->
      ReportString = io_lib:format("~s ~p", [Jid, Direction]),
      PrettyStanza =
          try
  