Feng Lee 10 лет назад
Родитель
Сommit
fa84a2595b
2 измененных файлов с 6 добавлено и 6 удалено
  1. 1 1
      src/emqttd_broker.erl
  2. 5 5
      src/emqttd_sm.erl

+ 1 - 1
src/emqttd_broker.erl

@@ -257,7 +257,7 @@ handle_call({unhook, Hook, Name}, _From, State) ->
     {reply, Reply, State};
     {reply, Reply, State};
 
 
 handle_call(Req, _From, State) ->
 handle_call(Req, _From, State) ->
-    lager:critical("Unexpected request: ~p", [Req]),
+    lager:error("Unexpected request: ~p", [Req]),
     {reply, {error, badreq}, State}.
     {reply, {error, badreq}, State}.
 
 
 handle_cast(_Msg, State) ->
 handle_cast(_Msg, State) ->

+ 5 - 5
src/emqttd_sm.erl

@@ -187,7 +187,7 @@ handle_call(_Request, _From, State) ->
     {reply, ok, State}.
     {reply, ok, State}.
 
 
 handle_cast(Msg, State) ->
 handle_cast(Msg, State) ->
-    lager:critical("Unexpected Msg: ~p", [Msg]),
+    lager:error("Unexpected Msg: ~p", [Msg]),
     {noreply, State}.
     {noreply, State}.
 
 
 handle_info({'DOWN', _MRef, process, DownPid, _Reason}, State) ->
 handle_info({'DOWN', _MRef, process, DownPid, _Reason}, State) ->
@@ -198,7 +198,7 @@ handle_info({'DOWN', _MRef, process, DownPid, _Reason}, State) ->
     {noreply, State};
     {noreply, State};
 
 
 handle_info(Info, State) ->
 handle_info(Info, State) ->
-    lager:critical("Unexpected Info: ~p", [Info]),
+    lager:error("Unexpected Info: ~p", [Info]),
     {noreply, State}.
     {noreply, State}.
 
 
 terminate(_Reason, #state{id = Id}) ->
 terminate(_Reason, #state{id = Id}) ->
@@ -220,7 +220,7 @@ create_session(CleanSess, ClientId, ClientPid) ->
             case insert_session(Session) of
             case insert_session(Session) of
                 {aborted, {conflict, ConflictPid}} ->
                 {aborted, {conflict, ConflictPid}} ->
                     %% Conflict with othe node?
                     %% Conflict with othe node?
-                    lager:critical("Session(~s): Conflict with ~p!", [ClientId, ConflictPid]),
+                    lager:error("Session(~s): Conflict with ~p!", [ClientId, ConflictPid]),
                     {error, conflict};
                     {error, conflict};
                 {atomic, ok} ->
                 {atomic, ok} ->
                     erlang:monitor(process, SessPid),
                     erlang:monitor(process, SessPid),
@@ -256,11 +256,11 @@ resume_session(Session = #mqtt_session{client_id = ClientId, sess_pid = SessPid}
         ok ->
         ok ->
             {ok, SessPid};
             {ok, SessPid};
         {badrpc, nodedown} ->
         {badrpc, nodedown} ->
-            lager:critical("Session(~s): Died for node ~s down!", [ClientId, Node]),
+            lager:error("Session(~s): Died for node ~s down!", [ClientId, Node]),
             remove_session(Session),
             remove_session(Session),
             {error, session_nodedown};
             {error, session_nodedown};
         {badrpc, Reason} ->
         {badrpc, Reason} ->
-            lager:critical("Session(~s): Failed to resume from node ~s for ~p",
+            lager:error("Session(~s): Failed to resume from node ~s for ~p",
                             [ClientId, Node, Reason]),
                             [ClientId, Node, Reason]),
             {error, Reason}
             {error, Reason}
     end.
     end.