anchor.diff:      nt_eventlog:deregister_event_source(Handle).
   
   %% @private
  +code_change("0.9.0", {state, Handle, Level}, _Extra) ->
  +    {ok, #state{handle = Handle, level = Level, format_config = lager_default_formatter, format_config = ?DEFAULT_FORMAT }};
   code_change(_OldVsn, State, _Extra) ->
       {ok, State}.
  
positive.code:     #state{handle = Handle, level = LogLevel} = State) when Level =< LogLevel ->
      nt_eventlog:report_event(Handle, Level, lists:flatten([Location, Message])),
      {ok, State};
  handle_event({log, Message}, #state{handle = Handle, level=Level} = State) ->
      case lager_util:is_loggable(Message, Level, ?MODULE) of
          true ->
              nt_eventlog:report_event(Handle, Level, lager_default_formatter:format(Message, ?DEFAULT_FORMAT)),
              {ok, State};
          false ->
              {ok, State}
  
negative.code: -export([init/1, handle_call/2, handle_event/2, handle_info/2, terminate/2,
          code_change/3]).
  
  -record(state, {handle, level, formatter, format_config}).
  
  -define(DEFAULT_FORMAT, [{pid, ""}, {module, [{pid, ["@"], ""}, module, {function, [":", function], ""}, {line, [":",line], ""}], ""}, " ", message]).
  -include_lib("lager/include/lager.hrl").
  
  %% @private
  init([Source, Level]) ->
      init([Source, Level, {lager_default_formatter, ?DEFAULT_FORMAT}]);
  init([Source, Level, {Formatter, FormatterConfig}]) ->
      case nt_eventlog:register_event_source(Source) of
          {ok, Handle} ->
              {ok, #state{level=lager_util:level_to_num(Level),
                          handle = Handle,
                          formatter = Formatter,
                          format_config = FormatterConfig}};
          Error ->
              Error
      end.
  