diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2019-09-25 11:28:42 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2019-09-25 11:28:42 +0300 |
| commit | ea79b7956d02833a79a7b4fe9dccb8ff3f3c9180 (patch) | |
| tree | 77e0933cc5057453f7c58d4b3dd4c08fe1b704eb /src/rabbit.erl | |
| parent | 697e0061adb6f10ed254a8c0702d4dad105a1fc1 (diff) | |
| download | rabbitmq-server-git-ea79b7956d02833a79a7b4fe9dccb8ff3f3c9180.tar.gz | |
Startup banner improvements
Include config file paths and doco links.
Diffstat (limited to 'src/rabbit.erl')
| -rw-r--r-- | src/rabbit.erl | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 7095966ced..5b13f8d238 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -267,8 +267,7 @@ %%---------------------------------------------------------------------------- -type restart_type() :: 'permanent' | 'transient' | 'temporary'. -%% this really should be an abstract type --type log_location() :: string(). + -type param() :: atom(). -type app_name() :: atom(). @@ -1124,11 +1123,14 @@ start_logger() -> rabbit_lager:start_logger(), ok. --spec log_locations() -> [log_location()]. - +-spec log_locations() -> [rabbit_lager:log_location()]. log_locations() -> rabbit_lager:log_locations(). +-spec config_locations() -> [rabbit_config:config_location()]. +config_locations() -> + rabbit_config:config_files(). + -spec force_event_refresh(reference()) -> 'ok'. % Note: https://www.pivotaltracker.com/story/show/166962656 @@ -1175,24 +1177,30 @@ erts_version_check() -> print_banner() -> {ok, Product} = application:get_key(description), {ok, Version} = application:get_key(vsn), - {LogFmt, LogLocations} = case log_locations() of - [_ | Tail] = LL -> - LF = lists:flatten(["~n ~ts" - || _ <- lists:seq(1, length(Tail))]), - {LF, LL}; - [] -> - {"", ["(none)"]} + LineListFormatter = fun (Placeholder, [_ | Tail] = LL) -> + LF = lists:flatten([Placeholder || _ <- lists:seq(1, length(Tail))]), + {LF, LL}; + (_, []) -> + {"", ["(none)"]} end, + %% padded list lines + {LogFmt, LogLocations} = LineListFormatter("~n ~ts", log_locations()), + {CfgFmt, CfgLocations} = LineListFormatter("~n ~ts", config_locations()), io:format("~n ## ##" "~n ## ## ~s ~s. ~s" "~n ########## ~s" "~n ###### ##" - "~n ########## Logs: ~ts" ++ - LogFmt ++ + "~n ########## Logs: ~ts" ++ LogFmt ++ "~n" + "~n Config file(s): ~ts" ++ CfgFmt ++ "~n" + "~n Tutorials: https://rabbitmq.com/getstarted.html" + "~n Doc guides: https://rabbitmq.com/documentation.html" + "~n Monitoring: https://rabbitmq.com/monitoring.html" + "~n Get help: https://rabbitmq.com/contact.html" "~n~n Starting broker..." "~n", [Product, Version, ?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE] ++ - LogLocations). + LogLocations ++ + CfgLocations). log_banner() -> {FirstLog, OtherLogs} = case log_locations() of |
