anchor.diff:       {token, Token}].
   
   drain_info(api_v1, Drain) ->
  -    iolist_to_binary(logplex_drain:url(Drain));
  -drain_info(api_v2, Drain = #drain{id = Id, token = Token}) ->
  -    [{id, Id},
  -     {token, Token},
  -     {url, iolist_to_binary(logplex_drain:url(Drain))}].
  +    uri:to_binary(logplex_drain:uri(Drain));
  +drain_info(api_v2, Drain) ->
  +    [{id, logplex_drain:id(Drain)},
  +     {token, logplex_drain:token(Drain)},
  +     {url, uri:to_binary(logplex_drain:uri(Drain))}].
   
   not_found_json() ->
       Json = {struct, [{error, <<"Not found">>}]},
  
positive.code:                                    || Token = #token{} <- Tokens])},
  
               {drains, lists:sort([drain_info(ApiVsn, Drain)
                                    || Drain = #drain{port = Port} <- Drains,
                                       Port =/= 0])}];
          not_found -> not_found
      end.
  
  
negative.code: -export([loop/1, start_link/0, stop/0]).
  
  -include("logplex.hrl").
  -include("logplex_logging.hrl").
  
  -define(HDR, [{"Content-Type", "text/html"}]).
  