add debug
This commit is contained in:
parent
73ff03de9c
commit
714ec1e734
@ -501,10 +501,9 @@ code_change(_OldVsn, StateName, State = #state{}, _Extra) ->
|
||||
handle_data(#{<<"device_uuid">> := DeviceUUID, <<"service_name">> := ServiceName, <<"at">> := Timestamp, <<"fields">> := FieldsList, <<"tags">> := Tags}, #state{uuid = UUID})
|
||||
when is_binary(DeviceUUID), DeviceUUID /= <<>> ->
|
||||
|
||||
lager:debug("[iot_host] host: ~p, handle device data: ~p, fields: ~p, tags: ~p", [UUID, DeviceUUID, FieldsList, Tags]),
|
||||
|
||||
case iot_device:get_pid(DeviceUUID) of
|
||||
undefined ->
|
||||
lager:warning("[iot_host] host uuid: ~p, device uuid: ~p not found, fields: ~p, tags: ~p", [UUID, DeviceUUID, FieldsList, Tags]),
|
||||
ok;
|
||||
DevicePid when is_pid(DevicePid) ->
|
||||
case iot_device:is_activated(DevicePid) of
|
||||
@ -518,7 +517,7 @@ handle_data(#{<<"device_uuid">> := DeviceUUID, <<"service_name">> := ServiceName
|
||||
|
||||
iot_device:change_status(DevicePid, ?DEVICE_ONLINE);
|
||||
false ->
|
||||
lager:notice("[iot_host] uuid: ~p, device_uuid: ~p, device is not activated", [UUID, DeviceUUID])
|
||||
lager:warning("[iot_host] host uuid: ~p, device_uuid: ~p not activated, fields: ~p, tags: ~p", [UUID, DeviceUUID, FieldsList, Tags])
|
||||
end
|
||||
end;
|
||||
|
||||
|
||||
@ -18,9 +18,9 @@ route_uuid(RouterUUID, Fields, Timestamp) when is_binary(RouterUUID), is_list(Fi
|
||||
%% 查找终端设备对应的点位信息
|
||||
case redis_client:hget(RouterUUID, <<"location_code">>) of
|
||||
{ok, undefined} ->
|
||||
lager:debug("[iot_host] the north_data hget location_code, uuid: ~p, not found", [RouterUUID]);
|
||||
lager:warning("[iot_host] the north_data hget location_code, uuid: ~p, not found", [RouterUUID]);
|
||||
{ok, LocationCode} when is_binary(LocationCode) ->
|
||||
iot_zd_endpoint:forward(LocationCode, Fields, Timestamp);
|
||||
{error, Reason} ->
|
||||
lager:debug("[iot_host] the north_data hget location_code uuid: ~p, get error: ~p", [RouterUUID, Reason])
|
||||
lager:warning("[iot_host] the north_data hget location_code uuid: ~p, get error: ~p", [RouterUUID, Reason])
|
||||
end.
|
||||
Loading…
x
Reference in New Issue
Block a user