Skip to content

Commit 52bd0d0

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 <gerhard@lazu.co.uk>
1 parent ee5c16e commit 52bd0d0

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

deps/rabbit/src/rabbit.erl

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,9 @@ start(normal, []) ->
858858
#{domain => ?RMQLOG_DOMAIN_PRELAUNCH});
859859
_ ->
860860
?LOG_INFO(
861-
"~n Starting ~s ~s on Erlang ~s~n ~s~n ~s",
861+
"~n Starting ~s ~s on Erlang ~s [~s]~n ~s~n ~s",
862862
[product_name(), product_version(), rabbit_misc:otp_release(),
863+
emu_flavor(),
863864
?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE],
864865
#{domain => ?RMQLOG_DOMAIN_PRELAUNCH})
865866
end,
@@ -1183,19 +1184,34 @@ print_banner() ->
11831184
io:format(Logo ++
11841185
"~n" ++
11851186
MOTDFormat ++
1186-
"~n Doc guides: https://rabbitmq.com/documentation.html"
1187-
"~n Support: https://rabbitmq.com/contact.html"
1188-
"~n Tutorials: https://rabbitmq.com/getstarted.html"
1189-
"~n Monitoring: https://rabbitmq.com/monitoring.html"
1187+
"~n Erlang: ~ts [~ts]"
1188+
"~n SSL Library: ~ts"
1189+
"~n"
1190+
"~n Doc guides: https://rabbitmq.com/documentation.html"
1191+
"~n Support: https://rabbitmq.com/contact.html"
1192+
"~n Tutorials: https://rabbitmq.com/getstarted.html"
1193+
"~n Monitoring: https://rabbitmq.com/monitoring.html"
11901194
"~n"
11911195
"~n Logs: ~ts" ++ LogFmt ++ "~n"
11921196
"~n Config file(s): ~ts" ++ CfgFmt ++ "~n"
11931197
"~n Starting broker...",
11941198
[Product, Version, ?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE] ++
1199+
[rabbit_misc:otp_release(), emu_flavor(), crypto_version()] ++
11951200
MOTDArgs ++
11961201
LogLocations ++
11971202
CfgLocations).
11981203

1204+
emu_flavor() ->
1205+
%% emu_flavor was introduced in Erlang 24 so we need to catch the error on Erlang 23
1206+
case catch(erlang:system_info(emu_flavor)) of
1207+
{'EXIT', _} -> "emu";
1208+
EmuFlavor -> EmuFlavor
1209+
end.
1210+
1211+
crypto_version() ->
1212+
[{CryptoLibName, _, CryptoLibVersion}] = crypto:info_lib(),
1213+
[CryptoLibName, " - ", CryptoLibVersion].
1214+
11991215
log_motd() ->
12001216
case motd() of
12011217
undefined ->

0 commit comments

Comments
 (0)