fix(coap): log error level only when it error
This commit is contained in:
parent
dc2f6303d4
commit
0fb81c7e99
|
@ -154,8 +154,11 @@ handle_info(Info, State) ->
|
||||||
|
|
||||||
terminate(Reason, #state{}) ->
|
terminate(Reason, #state{}) ->
|
||||||
ets:delete(?COAP_TOPIC_TABLE),
|
ets:delete(?COAP_TOPIC_TABLE),
|
||||||
?LOG(error, "the ~p terminate for reason ~p", [?MODULE, Reason]),
|
Level = case Reason =:= normal orelse Reason =:= shutdown of
|
||||||
ok.
|
true -> debug;
|
||||||
|
false -> error
|
||||||
|
end,
|
||||||
|
?SLOG(Level, #{terminate_reason => Reason}).
|
||||||
|
|
||||||
code_change(_OldVsn, State, _Extra) ->
|
code_change(_OldVsn, State, _Extra) ->
|
||||||
{ok, State}.
|
{ok, State}.
|
||||||
|
|
Loading…
Reference in New Issue