Skip to content

Commit

Permalink
Merge pull request #12395 from rabbitmq/mergify/bp/v4.0.x/pr-12394
Browse files Browse the repository at this point in the history
Make it possible to override the license line in the startup banner (backport #12394)
  • Loading branch information
michaelklishin authored Sep 27, 2024
2 parents 7e6a666 + 4aa1b42 commit 2d4aa12
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions deps/rabbit/src/rabbit.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
-export([product_info/0,
product_name/0,
product_version/0,
product_license_line/0,
base_product_name/0,
base_product_version/0,
motd_file/0,
Expand Down Expand Up @@ -920,14 +921,14 @@ start(normal, []) ->
[product_name(), product_version(), rabbit_misc:otp_release(),
emu_flavor(),
BaseName, BaseVersion,
?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE],
?COPYRIGHT_MESSAGE, product_license_line()],
#{domain => ?RMQLOG_DOMAIN_PRELAUNCH});
_ ->
?LOG_INFO(
"~n Starting ~ts ~ts on Erlang ~ts [~ts]~n ~ts~n ~ts",
[product_name(), product_version(), rabbit_misc:otp_release(),
emu_flavor(),
?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE],
?COPYRIGHT_MESSAGE, product_license_line()],
#{domain => ?RMQLOG_DOMAIN_PRELAUNCH})
end,
log_motd(),
Expand Down Expand Up @@ -1338,7 +1339,7 @@ print_banner() ->
"~n Logs: ~ts" ++ LogFmt ++ "~n"
"~n Config file(s): ~ts" ++ CfgFmt ++ "~n"
"~n Starting broker...",
[Product, Version, ?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE] ++
[Product, Version, ?COPYRIGHT_MESSAGE, product_license_line()] ++
[rabbit_misc:otp_release(), emu_flavor(), crypto_version()] ++
MOTDArgs ++
LogLocations ++
Expand Down Expand Up @@ -1522,6 +1523,10 @@ product_name() ->
#{product_base_name := BaseName} -> BaseName
end.

-spec product_license_line() -> string().
product_license_line() ->
application:get_env(rabbit, license_line, ?INFORMATION_MESSAGE).

-spec product_version() -> string().

product_version() ->
Expand Down

0 comments on commit 2d4aa12

Please sign in to comment.