From f1b207b2e43f890f0e0319b6ab0e824c953a0119 Mon Sep 17 00:00:00 2001 From: SisMaker <1713699517@qq.com> Date: Thu, 17 Feb 2022 12:29:13 +0800 Subject: [PATCH] =?UTF-8?q?pf:=20eSync=E6=97=A5=E5=BF=97=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/eSync.erl | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/eSync.erl b/src/eSync.erl index eceb537..fccc4d5 100644 --- a/src/eSync.erl +++ b/src/eSync.erl @@ -231,23 +231,23 @@ handleInfo({Port, {data, Data}}, Status, #state{srcFiles = Srcs, hrlFiles = Hrls {BSrcs, BHrls, BConfigs, BBeams} = collSrcFiles(true), {nextS, running, State#state{srcFiles = BSrcs, hrlFiles = BHrls, configs = BConfigs, beams = BBeams}, {isHib, true}}; _ -> - logErrors("error, eSync receive unexpect port msg ~p~n", [Data]), + logErrors("error, receive unexpect port msg ~p~n", [Data]), kpS_S end end; handleInfo({Port, closed}, running, #state{port = Port} = _State) -> - logErrors("eSync receive port closed ~n"), + logErrors("receive port closed ~n"), {nextS, port_close, _State}; handleInfo({'EXIT', Port, Reason}, running, #state{port = Port} = _State) -> - logErrors("eSync receive port exit Reason:~p ~n", [Reason]), + logErrors("receive port exit Reason:~p ~n", [Reason]), {nextS, {port_EXIT, Reason}, _State}; handleInfo({Port, {exit_status, Status}}, running, #state{port = Port} = _State) -> - logErrors("eSync receive port exit_status Status:~p ~p ~n", [Status, Port]), + logErrors("receive port exit_status Status:~p ~p ~n", [Status, Port]), {nextS, {port_exit_status, Status}, _State}; handleInfo({'EXIT', _Pid, _Reason}, running, _State) -> kpS_S; handleInfo(_Msg, _, _State) -> - logErrors("eSync receive unexpect msg:~p ~n", [_Msg]), + logErrors("receive unexpect msg:~p ~n", [_Msg]), kpS_S. handleOnevent(sTimeout, waitConnOver, Status, State) -> @@ -763,18 +763,19 @@ getEnv(Var, Default) -> setEnv(Var, Val) -> ok = application:set_env(eSync, Var, Val). +-define(LogTag, "eSync: "). logSuccess(Format) -> - canLog(success) andalso error_logger:info_msg(Format). + canLog(success) andalso error_logger:info_msg(?LogTag ++ Format). logSuccess(Format, Args) -> - canLog(success) andalso error_logger:info_msg(Format, Args). + canLog(success) andalso error_logger:info_msg(?LogTag ++ Format, Args). logErrors(Format) -> - canLog(errors) andalso error_logger:error_msg(Format). + canLog(errors) andalso error_logger:error_msg(?LogTag ++ Format). logErrors(Format, Args) -> - canLog(errors) andalso error_logger:error_msg(Format, Args). + canLog(errors) andalso error_logger:error_msg(?LogTag ++ Format, Args). logWarnings(Format, Args) -> - canLog(warnings) andalso error_logger:warning_msg(Format, Args). + canLog(warnings) andalso error_logger:warning_msg(?LogTag ++ Format, Args). canLog(MsgType) -> case eSync:getLog() of