Skip to content

Commit 441bceb

Browse files
mkuratczykgerhard
authored andcommitted
Print Erlang and SSL library on boot, right under the logo
This is purely for information purposes. We have often seen users copy-paste console output when reporting issues, and they miss the most important information: Erlang & SSL library versions. After this change, we are less likely to have ask about the Erlang & SSL library versions via follow-up questions. emu_flavor was introduced in Erlang 24. Erlang 23 has not JIT so we can always return "emu". FWIW, we discourage putting new code in rabbitmq_common as this is meant to be shared between the broker and the client. Also, keeping the function definitions close to where they are called is a good general practice. We discussed the benefits of having the OS line with @dumbbell & @gerhard and concluded that it's not worth the effort. Signed-off-by: Gerhard Lazu <[email protected]> (cherry picked from commit 52bd0d0) (cherry picked from commit 2e0e032)
1 parent d99c82f commit 441bceb

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

deps/rabbit/src/rabbit.erl

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -823,14 +823,16 @@ start(normal, []) ->
823823
#{product_overridden := true,
824824
product_base_name := BaseName,
825825
product_base_version := BaseVersion} ->
826-
_ = rabbit_log:info("~n Starting ~s ~s on Erlang ~s~n Based on ~s ~s~n ~s~n ~s~n",
826+
_ = rabbit_log:info("~n Starting ~s ~s on Erlang ~s [~s]~n Based on ~s ~s~n ~s~n ~s~n",
827827
[product_name(), product_version(), rabbit_misc:otp_release(),
828+
emu_flavor(),
828829
BaseName, BaseVersion,
829830
?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE]);
830831
_ ->
831-
_ = rabbit_log:info("~n Starting ~s ~s on Erlang ~s~n ~s~n ~s~n",
832+
_ = rabbit_log:info("~n Starting ~s ~s on Erlang ~s [~s]~n ~s~n ~s",
832833
[product_name(), product_version(), rabbit_misc:otp_release(),
833-
?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE])
834+
emu_flavor(),
835+
?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE]);
834836
end,
835837
log_motd(),
836838
{ok, SupPid} = rabbit_sup:start_link(),
@@ -1147,19 +1149,34 @@ print_banner() ->
11471149
io:format(Logo ++
11481150
"~n" ++
11491151
MOTDFormat ++
1150-
"~n Doc guides: https://rabbitmq.com/documentation.html"
1151-
"~n Support: https://rabbitmq.com/contact.html"
1152-
"~n Tutorials: https://rabbitmq.com/getstarted.html"
1153-
"~n Monitoring: https://rabbitmq.com/monitoring.html"
1152+
"~n Erlang: ~ts [~ts]"
1153+
"~n SSL Library: ~ts"
1154+
"~n"
1155+
"~n Doc guides: https://rabbitmq.com/documentation.html"
1156+
"~n Support: https://rabbitmq.com/contact.html"
1157+
"~n Tutorials: https://rabbitmq.com/getstarted.html"
1158+
"~n Monitoring: https://rabbitmq.com/monitoring.html"
11541159
"~n"
11551160
"~n Logs: ~ts" ++ LogFmt ++ "~n"
11561161
"~n Config file(s): ~ts" ++ CfgFmt ++ "~n"
11571162
"~n Starting broker...",
11581163
[Product, Version, ?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE] ++
1164+
[rabbit_misc:otp_release(), emu_flavor(), crypto_version()] ++
11591165
MOTDArgs ++
11601166
LogLocations ++
11611167
CfgLocations).
11621168

1169+
emu_flavor() ->
1170+
%% emu_flavor was introduced in Erlang 24 so we need to catch the error on Erlang 23
1171+
case catch(erlang:system_info(emu_flavor)) of
1172+
{'EXIT', _} -> "emu";
1173+
EmuFlavor -> EmuFlavor
1174+
end.
1175+
1176+
crypto_version() ->
1177+
[{CryptoLibName, _, CryptoLibVersion}] = crypto:info_lib(),
1178+
[CryptoLibName, " - ", CryptoLibVersion].
1179+
11631180
log_motd() ->
11641181
case motd() of
11651182
undefined ->

0 commit comments

Comments
 (0)