anchor.diff:      end, 1, Trace),
   
       %% Write trace.
  -    lists:foreach(fun(Line) ->
  -        io:format(CurrentTraceFile, "~p", [Line])
  -        end, Trace),
  +    case Replay of 
  +        true ->
  +            lager:info("~p: not writing trace, replay mode.", [?MODULE]),
  +            ok;
  +        false ->
  +            lager:info("~p: writing trace.", [?MODULE]),
  +
  +            lists:foreach(fun(Line) ->
  +                io:format(CurrentTraceFile, "~p~n", [Line])
  +                end, Trace)
  +    end,
   
       {reply, ok, State};
   handle_call(Msg, _From, State) ->
  
positive.code: init([]) ->
      lager:info("Test orchestrator started on node: ~p", [node()]),
  
      %% Open trace file for writing.
      case file:open("/tmp/partisan.trace", [write]) of
          {ok, CurrentTraceFile} ->
              {ok, #state{trace=[], current_trace_file=CurrentTraceFile}};
          {error, Error} ->
              lager:error("couldn't open trace file for writing."),
              {stop, Error}
      end.
  
  %% @private
  
negative.code:          terminate/2,
           code_change/3]).
  
  -record(state, {previous_trace=[],
                  trace=[], 
                  replay=false,
                  identifier=undefined, 
                  current_trace_file=undefined}).
  
  %%%===================================================================
  %%% API
  