chore(boot-log): print a warning at boot when running on old otp

This commit is contained in:
Zaiming Shi 2021-03-19 10:35:28 +01:00 committed by Zaiming (Stone) Shi
parent 2d150127d4
commit e06b54ff71
1 changed files with 10 additions and 0 deletions

View File

@ -33,6 +33,7 @@
%%--------------------------------------------------------------------
start(_Type, _Args) ->
print_otp_version_warning(),
print_banner(),
ekka:start(),
{ok, Sup} = emqx_sup:start_link(),
@ -56,6 +57,15 @@ stop(_State) ->
%% Print Banner
%%--------------------------------------------------------------------
-if(?OTP_RELEASE> 22).
print_otp_version_warning() -> ok.
-else.
print_otp_version_warning() ->
io:format("WARNING: Running on Erlang/OTP version ~p. Recommended: 23~n",
[?OTP_RELEASE]).
-endif.
print_banner() ->
io:format("Starting ~s on node ~s~n", [?APP, node()]).