anchor.diff:              debug;
           true ->
               undefined
  -    end,
  -    if
  -        LogLevel =:= undefined ->
  -            cloudi_core_i_logger_interface:error('LAGER(invalid_level)', 0,
  -                                                 undefined, undefined,
  -                                                 Format, Args);
  -        true ->
  -            cloudi_core_i_logger_interface:LogLevel('LAGER', 0,
  -                                                    undefined, undefined,
  -                                                    Format, Args)
       end.
  -
  -%%-------------------------------------------------------------------------
  -%% @doc
  -%% ===Get lager metadata.===
  -%% @end
  -%%-------------------------------------------------------------------------
  -
  --spec md() ->
  -    list({atom(), any()}).
  -
  -md() ->
  -    cloudi_core_i_logger:metadata_get().
  -
  -%%-------------------------------------------------------------------------
  -%% @doc
  -%% ===Set lager metadata.===
  -%% @end
  -%%-------------------------------------------------------------------------
  -
  --spec md(list({atom(), any()})) ->
  -    ok.
  -
  -md(MetaData) when is_list(MetaData) ->
  -    cloudi_core_i_logger:metadata_set(MetaData).
  -
  -%%-------------------------------------------------------------------------
  -%% @doc
  -%% ===Lager parse transform replacement for using CloudI logging.===
  -%% use {parse_transform, cloudi_logger_lager} as a compile option
  -%% instead of {parse_transform, lager_transform}
  -%% (e.g., -compile([{parse_transform, cloudi_logger_lager}]).)
  -%% @end
  -%%-------------------------------------------------------------------------
  -
  --spec parse_transform(Forms :: list(erl_parse:abstract_form() |
  -                                    erl_parse:form_info()),
  -                      CompileOptions :: list(compile:option())) ->
  -    list(erl_parse:abstract_form() | erl_parse:form_info()).
  -
  -parse_transform(Forms, _CompileOptions) ->
  -    forms_process(Forms, [], #state{}).
  -
  -%%%------------------------------------------------------------------------
  -%%% Private functions
  -%%%------------------------------------------------------------------------
   
   forms_process([{eof, _} = EOF], L, _) ->
       lists:reverse([EOF | L]);
  
positive.code:     ok = cloudi_core_i_logger:metadata_set(MetaData),
      log(Level, undefined, Format, Args);
  log(Level, _, Format, Args) ->
      % consistent with
      % cloudi_core_i_logger:lager_severity_output/1,
      % cloudi_core_i_logger:lager_severity_input/1 and
      % cloudi_core_i_configuration:logging_formatter_level/1
      LogLevel = if
          Level =:= critical; Level =:= alert; Level =:= emergency ->
              fatal;
          Level =:= error ->
  
negative.code:              #state{module = Module,
                      function_name = FunctionName,
                      function_arity = FunctionArity} = State) ->
      case log_level(Level) of
          undefined ->
              body_process(Statements, [Call | L], State);
          LogLevel ->
              NewArgsSuffix = case Args of
                  [{string, LagerFormatAnno, _} = LagerFormat] ->
                      [LagerFormat, {nil, LagerFormatAnno}];
  