anchor.diff:  -behaviour(gen_alog).
   -behaviour(gen_server).
   -include_lib("alog.hrl").
  +-include_lib("kernel/include/file.hrl").
   
   %% API
   -export([start_link/2]).
  
positive.code: -record(state, { log_ref
                 , log_fun
                 , opts
                 }).
  
  -define(DEF_SUP_REF, alog_sup).
  
  %% pre-defined key of 'format' option
  -define(FORMAT_ARG, format).
  
negative.code:   Format = gen_alog:get_opt(?FORMAT_ARG, DLArgs , ?FORMAT_DEF),
    Sync   = gen_alog:get_opt(?SYNC_ARG  , ADLArgs, ?SYNC_DEF),
    LogFun = get_log_fun(Format, Sync, ?LOG_FUNS),
    case disk_log:open(DLArgs) of
      {ok, LogRef} ->
        {LogRef, LogFun};
      {repaired, LogRef, _recovered, _badbytes} ->
        {LogRef, LogFun};
      Error ->
        throw(Error)
    end.
  