anchor.diff:  is_ct_available() ->
       code:is_loaded(ct) =/= false andalso ct:get_status() =/= no_tests_running.
   
  --spec do_log_stanza(binary(), in | out, exml:element()) -> ok.
  -do_log_stanza(Jid, Direction, Stanza) ->
  +-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
  
positive.code: -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);
          _ ->
              ok
      end.
  
negative.code:                        [ReportString, Stanza]),
                  ct:fail(Error)
          end,
      PrintFun = case Target of
                     console_and_file -> pal;
                     console -> print;
                     file -> log
                 end,
      %% grep anchor: ct:pal, ct:print, ct:log
      ct:PrintFun(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/>.
  