anchor.diff:      lists:foreach(fun(F) -> dbg:tp(ssh_auth, F, x) end,
                     [publickey_msg, password_msg, keyboard_interactive_msg]).
      
  -%%%----------------------------------------------------------------
  -stop() ->
  -    dbg:stop().
  -
   %%%================================================================
  -cond_start(Type, Write, MangleArg) ->
  +cond_start(Type, WriteFun, MangleArgFun, Init) ->
       try
           dbg:start(),
  -        setup_tracer(Type, Write, MangleArg),
  +        setup_tracer(Type, WriteFun, MangleArgFun, Init),
           dbg:p(new,[c,timestamp])
       catch
           _:_ -> ok
  
positive.code: -include("ssh_connect.hrl").
  -include("ssh_auth.hrl").
  
  -record(data, {
  	  writer,
  	  acc = []}).
  %%%================================================================
  messages() ->
      messages(fun(String,_D) -> io:format(String) end).
  
  ct_messages() ->
      messages(fun(String,_D) -> ct:log(String,[]) end).
  
  messages(Write) when is_function(Write,2) ->
      messages(Write, fun(X) -> X end).
  
  messages(Write, MangleArg) when is_function(Write,2),
  				is_function(MangleArg,1) ->
      cond_start(msg, Write, MangleArg),
      dbg_ssh_messages(),
      dbg_ssh_auth().
  
  
  auth() ->
      auth(fun(String,_D) -> io:format(String) end).
  
  ct_auth() ->
      auth(fun(String,_D) -> ct:log(String,[]) end).
  
  auth(Write) when is_function(Write,2) ->
      auth(Write, fun(X) -> X end).
  
  auth(Write, MangleArg) when is_function(Write,2),
  				is_function(MangleArg,1) ->
      cond_start(auth, Write, MangleArg),
      dbg_ssh_auth().
  
  
  dbg_ssh_messages() ->
      dbg:tp(ssh_message,encode,1, x),
      dbg:tp(ssh_message,decode,1, x),
      dbg:tpl(ssh_transport,select_algorithm,4, x),
      dbg:tp(ssh_transport,hello_version_msg,1, x),
      dbg:tp(ssh_transport,handle_hello_version,1, x),
      dbg:tpl(ssh_connection_handler,ext_info,2, x).
     
  dbg_ssh_auth() ->
      dbg:tp(ssh_transport,hello_version_msg,1, x),
      dbg:tp(ssh_transport,handle_hello_version,1, x),
      dbg:tp(ssh_message,encode,1, x),
  
negative.code: msg_formater(_, _, D) -> 
       D.
  
  %%%----------------------------------------------------------------
  -record(data, {writer,
                 acc}).
  
  fmt(Fmt, Args,  D=#data{writer=Write, acc=Acc}) ->
      D#data{acc = Write(Fmt,Args,Acc)}.
  
  ts({_,_,Usec}=Now) ->
      {_Date,{HH,MM,SS}} = calendar:now_to_local_time(Now),
      io_lib:format("~.2.0w:~.2.0w:~.2.0w.~.6.0w",[HH,MM,SS,Usec]);
  ts(_) ->
      "-".
  
  setup_tracer(Type, WriteFun, MangleArgFun, Init) ->
      Handler = fun(Arg, D) ->
  		      msg_formater(Type, MangleArgFun(Arg), D)
  	      end,
      InitialData = #data{writer = WriteFun,
                          acc = Init},
      {ok,_} = dbg:tracer(process, {Handler, InitialData}),
      ok.
  
  