add donghuoliren debug

This commit is contained in:
anlicheng 2024-12-16 19:40:41 +08:00
parent 7b6d46cb69
commit 6b47389d5c

View File

@ -86,8 +86,8 @@ init([]) ->
{noreply, NewState :: #state{}, timeout() | hibernate} | {noreply, NewState :: #state{}, timeout() | hibernate} |
{stop, Reason :: term(), Reply :: term(), NewState :: #state{}} | {stop, Reason :: term(), Reply :: term(), NewState :: #state{}} |
{stop, Reason :: term(), NewState :: #state{}}). {stop, Reason :: term(), NewState :: #state{}}).
handle_call(get_status, _From, State = #state{succ_counter = SuccCounter, fail_counter = FailCounter}) -> handle_call(get_status, _From, State = #state{succ_counter = SuccCounter, location_map = LocationMap, fail_counter = FailCounter}) ->
{reply, {ok, #{succ => SuccCounter, fail => FailCounter}}, State}. {reply, {ok, #{succ => SuccCounter, location_map => LocationMap, fail => FailCounter}}, State}.
%% @private %% @private
%% @doc Handling cast messages %% @doc Handling cast messages
@ -99,6 +99,7 @@ handle_cast({forward, LocationCode, DynamicLocationCode, EventType, Params},
State = #state{url = Url, token = Token, location_map = LocationMap, logger_pid = LoggerPid, succ_counter = SuccCounter, fail_counter = FailCounter}) -> State = #state{url = Url, token = Token, location_map = LocationMap, logger_pid = LoggerPid, succ_counter = SuccCounter, fail_counter = FailCounter}) ->
Location = maps:get(LocationCode, LocationMap, <<"">>), Location = maps:get(LocationCode, LocationMap, <<"">>),
lager:debug("[iot_donghuoliren_endpoint] location_code: ~p, location: ~ts", [LocationCode, Location]),
case format_event(Location, DynamicLocationCode, EventType, Params) of case format_event(Location, DynamicLocationCode, EventType, Params) of
{ok, Body} -> {ok, Body} ->
%% %%