anchor.diff:  init(Fun) ->
       {Name, _Cmd, _Args, Opts} = Params = Fun(),
       process_flag(trap_exit, true), % Make sure terminate gets called
  -    Opts2 = proplists:delete(port_server_send_eol, proplists:delete(port_server_dont_start, Opts)),
  +    Opts2 = lists:foldl(fun proplists:delete/2, Opts,
  +                        [port_server_send_eol, port_server_dont_start, log]),
       SendEOL = proplists:get_value(port_server_send_eol, Opts),
       DontStart = proplists:get_bool(port_server_dont_start, Opts),
  +    Log = proplists:get_value(log, Opts),
       Params2 = erlang:setelement(4, Params, Opts2),
  +
  +    State =
  +        case Log of
  +            undefined ->
  +                #state{};
  +            _ when is_list(Log) ->
  +                Sink = Logger = Name,
  +
  +                ok = ns_server:start_disk_sink(Sink, Log),
  +
  +                ale:stop_logger(Logger),
  +                ok = ale:start_logger(Logger, debug, ale_noop_formatter),
  +
  +                ok = ale:add_sink(Logger, Sink, debug),
  +
  +                #state{logger=Name}
  +        end,
  +
       Port = case DontStart of
                  false -> open_port(Params2);
                  true -> {inactive, Params2}
              end,
  -    {ok, #state{port = Port, name = Name, send_eol = SendEOL,
  -                messages = ringbuffer:new(?NUM_MESSAGES)}}.
  +    {ok, State#state{port = Port, name = Name, send_eol = SendEOL,
  +                     messages = ringbuffer:new(?NUM_MESSAGES)}}.
   
   handle_info({send_to_port, Msg}, #state{port = P} = State) when not is_port(P) ->
       ?log_debug("Got send_to_port when there's no port running yet. Will kill myself."),
  
positive.code:                                  [Dropped, State#state.name])
              end
      end,
      State#state{log_tref=undefined, log_buffer=[], dropped=0}.
  
  
  open_port({_Name, Cmd, Args, OptsIn}) ->
  
negative.code: -record(state, {port :: port() | {inactive, tuple()},
                  name :: term(),
                  messages,
                  logger :: atom(),
                  log_tref :: timer:tref(),
                  log_buffer = [],
                  dropped=0 :: non_neg_integer(),
  