anchor.diff:      %% stop sending epidemic messages
       erlang:erase(trace_mpath),
       ok.
  +
  +-spec register_callback(CallbackFun::callback_on_deliver()) -> ok | failed.
  +register_callback(CallbackFun) ->
  +    register_callback(CallbackFun, default).
  +
  +-spec register_callback(CallbackFun::callback_on_deliver(), trace_id()) -> ok | failed.
  +register_callback(CallbackFun, TraceId) ->
  +    %% clear infection
  +    PState = erlang:get(trace_mpath),
  +    stop(),
  +    %% register the callback function
  +    LoggerPid = pid_groups:find_a(proto_sched),
  +    comm:send_local(LoggerPid, {register_callback, CallbackFun, TraceId, comm:this()}),
  +    %% restore infection
  +    own_passed_state_put(PState),
  +    receive
  +        ?SCALARIS_RECV({register_callback_reply, Result}, Result)
  +    end.
   
   -spec get_infos() -> [tuple()].
   get_infos() -> get_infos(default).
  
positive.code: -export([start/0, start/1, start/2, stop/0]).
  -export([start_deliver/0, start_deliver/1]).
  -export([get_infos/0, get_infos/1]).
  -export([cleanup/0, cleanup/1]).
  
  %% report messages from other modules
  
negative.code:     TraceId = get_trace_id(get_passed_state(Msg)),
      ?TRACE("send error for trace id ~p: ~p calling on_handler_done~n", [TraceId, _ShepherdMsg]),
      gen_component:post_op(State, {on_handler_done, TraceId});
  
  on({register_callback, CallbackFun, TraceId, Client}, State) ->
      case lists:keyfind(TraceId, 1, State) of
          false ->
              comm:send(Client, {register_callback_reply, failed}),
              State;
          {TraceId, TraceEntry} ->
              comm:send(Client, {register_callback_reply, ok}),
              NewEntry = TraceEntry#state{callback_on_deliver = CallbackFun},
              lists:keyreplace(TraceId, 1, State, {TraceId, NewEntry})
      end;
  
  on({get_infos, Client, TraceId}, State) ->
      case lists:keyfind(TraceId, 1, State) of
  