lager:info -> lager:debug
This commit is contained in:
parent
77a0e9a85b
commit
557c341106
|
@ -132,17 +132,17 @@ handle_info({inet_reply, _Sock, {error, Reason}}, State = #state{peer_name = Pee
|
|||
{noreply, State};
|
||||
|
||||
handle_info({keepalive, start, TimeoutSec}, State = #state{transport = Transport, socket = Socket}) ->
|
||||
lager:info("Client ~s: Start KeepAlive with ~p seconds", [State#state.peer_name, TimeoutSec]),
|
||||
lager:debug("Client ~s: Start KeepAlive with ~p seconds", [State#state.peer_name, TimeoutSec]),
|
||||
KeepAlive = emqttd_keepalive:new({Transport, Socket}, TimeoutSec, {keepalive, timeout}),
|
||||
{noreply, State#state{ keepalive = KeepAlive }};
|
||||
|
||||
handle_info({keepalive, timeout}, State = #state{keepalive = KeepAlive}) ->
|
||||
case emqttd_keepalive:resume(KeepAlive) of
|
||||
timeout ->
|
||||
lager:info("Client ~s: Keepalive Timeout!", [State#state.peer_name]),
|
||||
lager:debug("Client ~s: Keepalive Timeout!", [State#state.peer_name]),
|
||||
stop({shutdown, keepalive_timeout}, State#state{keepalive = undefined});
|
||||
{resumed, KeepAlive1} ->
|
||||
lager:info("Client ~s: Keepalive Resumed", [State#state.peer_name]),
|
||||
lager:debug("Client ~s: Keepalive Resumed", [State#state.peer_name]),
|
||||
{noreply, State#state{keepalive = KeepAlive1}}
|
||||
end;
|
||||
|
||||
|
@ -151,7 +151,7 @@ handle_info(Info, State = #state{peer_name = PeerName}) ->
|
|||
{stop, {badinfo, Info}, State}.
|
||||
|
||||
terminate(Reason, #state{peer_name = PeerName, keepalive = KeepAlive, proto_state = ProtoState}) ->
|
||||
lager:info("Client ~s: ~p terminated, reason: ~p~n", [PeerName, self(), Reason]),
|
||||
lager:debug("Client ~s: ~p terminated, reason: ~p~n", [PeerName, self(), Reason]),
|
||||
notify(disconnected, Reason, ProtoState),
|
||||
emqttd_keepalive:cancel(KeepAlive),
|
||||
case {ProtoState, Reason} of
|
||||
|
|
|
@ -92,7 +92,7 @@ received(_Packet, State = #proto_state{connected = false}) ->
|
|||
|
||||
received(Packet = ?PACKET(_Type), State = #proto_state{peer_name = PeerName,
|
||||
client_id = ClientId}) ->
|
||||
lager:info("RECV from ~s@~s: ~s", [ClientId, PeerName, emqttd_packet:dump(Packet)]),
|
||||
lager:debug("RECV from ~s@~s: ~s", [ClientId, PeerName, emqttd_packet:dump(Packet)]),
|
||||
case validate_packet(Packet) of
|
||||
ok ->
|
||||
handle(Packet, State);
|
||||
|
@ -109,7 +109,7 @@ handle(Packet = ?CONNECT_PACKET(Var), State = #proto_state{peer_name = PeerName}
|
|||
keep_alive = KeepAlive,
|
||||
client_id = ClientId} = Var,
|
||||
|
||||
lager:info("RECV from ~s@~s: ~s", [ClientId, PeerName, emqttd_packet:dump(Packet)]),
|
||||
lager:debug("RECV from ~s@~s: ~s", [ClientId, PeerName, emqttd_packet:dump(Packet)]),
|
||||
|
||||
{ReturnCode1, State1} =
|
||||
case validate_connect(Var, State) of
|
||||
|
@ -198,7 +198,7 @@ send({_From, Message = #mqtt_message{qos = Qos}}, State = #proto_state{session =
|
|||
send(emqttd_message:to_packet(Message1), State#proto_state{session = NewSession});
|
||||
|
||||
send(Packet, State = #proto_state{transport = Transport, socket = Sock, peer_name = PeerName, client_id = ClientId}) when is_record(Packet, mqtt_packet) ->
|
||||
lager:info("SENT to ~s@~s: ~s", [ClientId, PeerName, emqttd_packet:dump(Packet)]),
|
||||
lager:debug("SENT to ~s@~s: ~s", [ClientId, PeerName, emqttd_packet:dump(Packet)]),
|
||||
sent_stats(Packet),
|
||||
Data = emqttd_serialiser:serialise(Packet),
|
||||
lager:debug("SENT to ~s: ~p", [PeerName, Data]),
|
||||
|
@ -215,7 +215,7 @@ redeliver({?PUBREL, PacketId}, State) ->
|
|||
shutdown(Error, #proto_state{peer_name = PeerName, client_id = ClientId, will_msg = WillMsg}) ->
|
||||
send_willmsg(WillMsg),
|
||||
try_unregister(ClientId, self()),
|
||||
lager:info("Protocol ~s@~s Shutdown: ~p", [ClientId, PeerName, Error]),
|
||||
lager:debug("Protocol ~s@~s Shutdown: ~p", [ClientId, PeerName, Error]),
|
||||
ok.
|
||||
|
||||
willmsg(Packet) when is_record(Packet, mqtt_packet_connect) ->
|
||||
|
|
|
@ -63,7 +63,7 @@ start_link() ->
|
|||
%%------------------------------------------------------------------------------
|
||||
-spec route(mqtt_message()) -> ok.
|
||||
route(Msg) ->
|
||||
lager:info("Route ~s", [emqttd_message:dump(Msg)]),
|
||||
lager:debug("Route ~s", [emqttd_message:dump(Msg)]),
|
||||
% TODO: need to retain?
|
||||
emqttd_server:retain(Msg),
|
||||
% unset flag and pubsub
|
||||
|
|
Loading…
Reference in New Issue