anchor.diff:  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{id = {?MODULE, Source},
  -                        level=lager_util:level_to_num(Level),
  -                        handle = Handle,
  -                        formatter = Formatter,
  -                        format_config = FormatterConfig}};
  +    case parse_level(Level) of
  +        {ok, Lvl} ->
  +            case nt_eventlog:register_event_source(Source) of
  +                {ok, Handle} ->
  +                    {ok, #state{id = {?MODULE, Source},
  +                                level = Lvl,
  +                                handle = Handle,
  +                                formatter = Formatter,
  +                                format_config = FormatterConfig}};
  +                Error ->
  +                    Error
  +            end;
           Error ->
               Error
       end.
  
positive.code: handle_event({log, Message}, #state{handle = Handle, level = Level, formatter = Formatter, format_config = FormatConfig} = State) ->
      case lager_util:is_loggable(Message, Level, State#state.id) of
          true ->
              nt_eventlog:report_event(Handle, Level, Formatter:format(Message, FormatConfig)),
              {ok, State};
          false ->
              {ok, State}
  
negative.code:     {ok, State}.
  
  config_to_id([Source | _]) ->
      {?MODULE, Source}.
  
  %% @private
  parse_level(Level) ->
      case parse_level(Level, 2) of
          {error, _} ->
              parse_level(Level, 1);
          Mask ->
              Mask
      end.
  
  parse_level(Level, 2) ->
      try lager_util:config_to_mask(Level) of
          Res ->
              {ok, Res}
      catch
          _:_ ->
              {error, bad_log_level}
      end;
  parse_level(Level, 1) ->
      try lager_util:level_to_num(Level) of
          Res ->
              {ok, Res}
      catch
          _:_ ->
              {error, bad_log_level}
      end.