Skip to content

Commit

Permalink
chore(gw): improve the listener started banner
Browse files Browse the repository at this point in the history
  • Loading branch information
HJianBo committed Sep 9, 2021
1 parent 020e04e commit 5da085b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions apps/emqx_gateway/src/coap/emqx_coap_impl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ start_listener(GwName, Ctx, {Type, LisName, ListenOn, SocketOpts, Cfg}) ->
ListenOnStr = emqx_gateway_utils:format_listenon(ListenOn),
case start_listener(GwName, Ctx, Type, LisName, ListenOn, SocketOpts, Cfg) of
{ok, Pid} ->
?ULOG("Start listener ~s:~s:~s on ~s successfully.~n",
?ULOG("Gateway ~s:~s:~s on ~s started.~n",
[GwName, Type, LisName, ListenOnStr]),
Pid;
{error, Reason} ->
?ELOG("Failed to start listener ~s:~s:~s on ~s: ~0p~n",
?ELOG("Failed to start gateway ~s:~s:~s on ~s: ~0p~n",
[GwName, Type, LisName, ListenOnStr, Reason]),
throw({badconf, Reason})
end.
Expand All @@ -118,10 +118,10 @@ stop_listener(GwName, {Type, LisName, ListenOn, SocketOpts, Cfg}) ->
StopRet = stop_listener(GwName, Type, LisName, ListenOn, SocketOpts, Cfg),
ListenOnStr = emqx_gateway_utils:format_listenon(ListenOn),
case StopRet of
ok -> ?ULOG("Stop listener ~s:~s:~s on ~s successfully.~n",
[GwName, Type, LisName, ListenOnStr]);
ok -> ?ULOG("Gateway ~s:~s:~s on ~s stopped.~n",
[GwName, Type, LisName, ListenOnStr]);
{error, Reason} ->
?ELOG("Failed to stop listener ~s:~s:~s on ~s: ~0p~n",
?ELOG("Failed to stop gateway ~s:~s:~s on ~s: ~0p~n",
[GwName, Type, LisName, ListenOnStr, Reason])
end,
StopRet.
Expand Down
10 changes: 5 additions & 5 deletions apps/emqx_gateway/src/exproto/emqx_exproto_impl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ start_listener(GwName, Ctx, {Type, LisName, ListenOn, SocketOpts, Cfg}) ->
ListenOnStr = emqx_gateway_utils:format_listenon(ListenOn),
case start_listener(GwName, Ctx, Type, LisName, ListenOn, SocketOpts, Cfg) of
{ok, Pid} ->
?ULOG("Start listener ~s:~s:~s on ~s successfully.~n",
[GwName, Type, LisName, ListenOnStr]),
?ULOG("Gateway ~s:~s:~s on ~s started.~n",
[GwName, Type, LisName, ListenOnStr]),
Pid;
{error, Reason} ->
?ELOG("Failed to start listener ~s:~s:~s on ~s: ~0p~n",
?ELOG("Failed to start gateway ~s:~s:~s on ~s: ~0p~n",
[GwName, Type, LisName, ListenOnStr, Reason]),
throw({badconf, Reason})
end.
Expand Down Expand Up @@ -197,10 +197,10 @@ stop_listener(GwName, {Type, LisName, ListenOn, SocketOpts, Cfg}) ->
StopRet = stop_listener(GwName, Type, LisName, ListenOn, SocketOpts, Cfg),
ListenOnStr = emqx_gateway_utils:format_listenon(ListenOn),
case StopRet of
ok -> ?ULOG("Stop listener ~s:~s:~s on ~s successfully.~n",
ok -> ?ULOG("Gateway ~s:~s:~s on ~s stopped.~n",
[GwName, Type, LisName, ListenOnStr]);
{error, Reason} ->
?ELOG("Failed to stop listener ~s:~s:~s on ~s: ~0p~n",
?ELOG("Failed to stop gateway ~s:~s:~s on ~s: ~0p~n",
[GwName, Type, LisName, ListenOnStr, Reason])
end,
StopRet.
Expand Down
8 changes: 4 additions & 4 deletions apps/emqx_gateway/src/lwm2m/emqx_lwm2m_impl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ start_listener(GwName, Ctx, {Type, LisName, ListenOn, SocketOpts, Cfg}) ->
ListenOnStr = emqx_gateway_utils:format_listenon(ListenOn),
case start_listener(GwName, Ctx, Type, LisName, ListenOn, SocketOpts, Cfg) of
{ok, Pid} ->
?ULOG("Start listener ~s:~s:~s on ~s successfully.~n",
?ULOG("Gateway ~s:~s:~s on ~s started.~n",
[GwName, Type, LisName, ListenOnStr]),
Pid;
{error, Reason} ->
?ELOG("Failed to start listener ~s:~s:~s on ~s: ~0p~n",
?ELOG("Failed to start gateway ~s:~s:~s on ~s: ~0p~n",
[GwName, Type, LisName, ListenOnStr, Reason]),
throw({badconf, Reason})
end.
Expand Down Expand Up @@ -129,10 +129,10 @@ stop_listener(GwName, {Type, LisName, ListenOn, SocketOpts, Cfg}) ->
StopRet = stop_listener(GwName, Type, LisName, ListenOn, SocketOpts, Cfg),
ListenOnStr = emqx_gateway_utils:format_listenon(ListenOn),
case StopRet of
ok -> ?ULOG("Stop listener ~s:~s:~s on ~s successfully.~n",
ok -> ?ULOG("Gateway ~s:~s:~s on ~s stopped.~n",
[GwName, Type, LisName, ListenOnStr]);
{error, Reason} ->
?ELOG("Failed to stop listener ~s:~s:~s on ~s: ~0p~n",
?ELOG("Failed to stop gateway ~s:~s:~s on ~s: ~0p~n",
[GwName, Type, LisName, ListenOnStr, Reason])
end,
StopRet.
Expand Down
8 changes: 4 additions & 4 deletions apps/emqx_gateway/src/mqttsn/emqx_sn_impl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ start_listener(GwName, Ctx, {Type, LisName, ListenOn, SocketOpts, Cfg}) ->
ListenOnStr = emqx_gateway_utils:format_listenon(ListenOn),
case start_listener(GwName, Ctx, Type, LisName, ListenOn, SocketOpts, Cfg) of
{ok, Pid} ->
?ULOG("Start listener ~s:~s:~s on ~s successfully.~n",
?ULOG("Gateway ~s:~s:~s on ~s started.~n",
[GwName, Type, LisName, ListenOnStr]),
Pid;
{error, Reason} ->
?ELOG("Failed to start listener ~s:~s:~s on ~s: ~0p~n",
?ELOG("Failed to start gateway ~s:~s:~s on ~s: ~0p~n",
[GwName, Type, LisName, ListenOnStr, Reason]),
throw({badconf, Reason})
end.
Expand Down Expand Up @@ -141,10 +141,10 @@ stop_listener(GwName, {Type, LisName, ListenOn, SocketOpts, Cfg}) ->
StopRet = stop_listener(GwName, LisName, Type, ListenOn, SocketOpts, Cfg),
ListenOnStr = emqx_gateway_utils:format_listenon(ListenOn),
case StopRet of
ok -> ?ULOG("Stop listener ~s:~s:~s on ~s successfully.~n",
ok -> ?ULOG("Gateway ~s:~s:~s on ~s stopped.~n",
[GwName, Type, LisName, ListenOnStr]);
{error, Reason} ->
?ELOG("Failed to stop listener ~s:~s:~s on ~s: ~0p~n",
?ELOG("Failed to stop gatewat ~s:~s:~s on ~s: ~0p~n",
[GwName, Type, LisName, ListenOnStr, Reason])
end,
StopRet.
Expand Down
8 changes: 4 additions & 4 deletions apps/emqx_gateway/src/stomp/emqx_stomp_impl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ start_listener(GwName, Ctx, {Type, LisName, ListenOn, SocketOpts, Cfg}) ->
ListenOnStr = emqx_gateway_utils:format_listenon(ListenOn),
case start_listener(GwName, Ctx, Type, LisName, ListenOn, SocketOpts, Cfg) of
{ok, Pid} ->
?ULOG("Start listener ~s:~s:~s on ~s successfully.~n",
?ULOG("Gateway ~s:~s:~s on ~s started.~n",
[GwName, Type, LisName, ListenOnStr]),
Pid;
{error, Reason} ->
?ELOG("Failed to start listener ~s:~s:~s on ~s: ~0p~n",
?ELOG("Failed to start gateway ~s:~s:~s on ~s: ~0p~n",
[GwName, Type, LisName, ListenOnStr, Reason]),
throw({badconf, Reason})
end.
Expand Down Expand Up @@ -126,10 +126,10 @@ stop_listener(GwName, {Type, LisName, ListenOn, SocketOpts, Cfg}) ->
StopRet = stop_listener(GwName, Type, LisName, ListenOn, SocketOpts, Cfg),
ListenOnStr = emqx_gateway_utils:format_listenon(ListenOn),
case StopRet of
ok -> ?ULOG("Stop listener ~s:~s:~s on ~s successfully.~n",
ok -> ?ULOG("Gateway ~s:~s:~s on ~s stopped.~n",
[GwName, Type, LisName, ListenOnStr]);
{error, Reason} ->
?ELOG("Failed to stop listener ~s:~s:~s on ~s: ~0p~n",
?ELOG("Failed to stop gateway ~s:~s:~s on ~s: ~0p~n",
[GwName, Type, LisName, ListenOnStr, Reason])
end,
StopRet.
Expand Down

0 comments on commit 5da085b

Please sign in to comment.