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: handle_call({identify, Identifier}, _From, State) ->
      lager:info("~p: identifying trace: ~p", [?MODULE, Identifier]),
      {reply, ok, State#state{identifier=Identifier}};
  handle_call(print, _From, #state{trace=Trace, current_trace_file=CurrentTraceFile}=State) ->
      lager:info("~p: printing trace", [?MODULE]),
  
      lists:foldl(fun({Type, Message}, Count) ->
  
negative.code: init([]) ->
      lager:info("Test orchestrator started on node: ~p", [node()]),
  
      %% Trace file.
      FileName = "/tmp/partisan.trace",
  
      case os:getenv("REPLAY") of 
          false ->
              %% This is not a replay, so store the current trace.
              lager:info("~p: recording trace to file.", [?MODULE]),
  
              case file:open(FileName, [write]) of
                  {ok, TraceFile} ->
                      {ok, #state{trace=[], current_trace_file=TraceFile}};
                  {error, Error} ->
                      lager:error("couldn't open current trace file for writing."),
                      {stop, Error}
              end;
          _ ->
              %% This is a replay, so load the previous trace.
              lager:info("~p: loading previous trace for replay.", [?MODULE]),
  
              {ok, Data} = file:read_file(FileName),
              Lines = binary:split(Data, [<<"\n">>], [global]),
              {ok, #state{previous_trace=Lines, replay=true}}
      end.
  
  %% @private
  