From cc4642feb21335b05190b04f0ae5aaf370765b53 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Thu, 26 Sep 2024 23:45:17 -0400 Subject: [PATCH] Make it possible to override the license line in the startup banner This is for Tanzu RabbitMQ, nothing changes for the open source edition. (cherry picked from commit b81590258581974943b2932015abd1460ea642ff) (cherry picked from commit 4aa1b4222873264afdc0bd3b19df6c2f3f05e165) --- deps/rabbit/src/rabbit.erl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/deps/rabbit/src/rabbit.erl b/deps/rabbit/src/rabbit.erl index e12045e7b50c..707e38eec03e 100644 --- a/deps/rabbit/src/rabbit.erl +++ b/deps/rabbit/src/rabbit.erl @@ -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, @@ -919,14 +920,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(), @@ -1313,7 +1314,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 ++ @@ -1497,6 +1498,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() ->