From 0b90c99f0689d3b98942555bda4d97aa5917fcf7 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Sun, 10 Nov 2024 12:38:00 +0800 Subject: [PATCH] fix debug info --- apps/iot/src/iot_api.erl | 2 +- apps/iot/src/iot_host.erl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/iot/src/iot_api.erl b/apps/iot/src/iot_api.erl index 4d92f02..1d22c43 100644 --- a/apps/iot/src/iot_api.erl +++ b/apps/iot/src/iot_api.erl @@ -32,7 +32,7 @@ ai_event(Id) when is_integer(Id) -> case hackney:request(post, Url, Headers, Body, [{pool, false}]) of {ok, 200, _, ClientRef} -> {ok, RespBody} = hackney:body(ClientRef), - lager:debug("[iot_api] send body: ~p, get error is: ~p", [Body, RespBody]), + lager:debug("[iot_api] send body: ~p, get response is: ~p", [Body, RespBody]), hackney:close(ClientRef); {ok, HttpCode, _, ClientRef} -> {ok, RespBody} = hackney:body(ClientRef), diff --git a/apps/iot/src/iot_host.erl b/apps/iot/src/iot_host.erl index cc3a4ce..ab852d9 100644 --- a/apps/iot/src/iot_host.erl +++ b/apps/iot/src/iot_host.erl @@ -485,12 +485,12 @@ handle_event(cast, {handle, {event, Event0}}, ?STATE_ACTIVATED, State = #state{u handle_event(cast, {handle, {ai_event, Event0}}, ?STATE_ACTIVATED, State = #state{uuid = UUID, aes = AES, has_session = true}) -> EventText = iot_cipher_aes:decrypt(AES, Event0), - lager:debug("[iot_host] uuid: ~p, get ai_event: ~p", [UUID, EventText]), + lager:debug("[iot_host] ai_event uuid: ~p, text: ~p", [UUID, EventText]), case catch jiffy:decode(EventText, [return_maps]) of #{<<"event_type">> := EventType, <<"params">> := Params0 = #{<<"device_uuid">> := DeviceUUID, <<"props">> := Props}} -> case iot_device:is_alive(DeviceUUID) of error -> - lager:notice("[iot_host] uuid: ~p, device_uuid: ~p is not alive, get ai_event: ~p", [UUID, DeviceUUID, EventText]), + lager:notice("[iot_host] ai_event uuid: ~p, device_uuid: ~p is not alive, text: ~p", [UUID, DeviceUUID, EventText]), ok; {ok, DevicePid} -> Params = maps:remove(<<"props">>, Params0), @@ -509,9 +509,9 @@ handle_event(cast, {handle, {ai_event, Event0}}, ?STATE_ACTIVATED, State = #stat iot_device:ai_event(DevicePid, EventType, Params) end; Event when is_map(Event) -> - lager:warning("[iot_host] host: ~p, event: ~p, not supported", [UUID, Event]); + lager:warning("[iot_host] ai_event host: ~p, text: ~p, not supported", [UUID, Event]); Other -> - lager:warning("[iot_host] host: ~p, event error: ~p", [UUID, Other]) + lager:warning("[iot_host] ai_event host: ~p, error: ~p", [UUID, Other]) end, {keep_state, State};