diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2011-01-16 13:20:47 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-01-16 13:20:47 +0000 |
| commit | 9739b8ab3f6bb2e694e16e8d7a4f2fa30b6f5ffd (patch) | |
| tree | 9560d46b388ebd309fae54821e23aed3a69fceeb /src | |
| parent | 9ff954b2154b39bbe9adc2730733fd0fe3562d02 (diff) | |
| download | rabbitmq-server-git-9739b8ab3f6bb2e694e16e8d7a4f2fa30b6f5ffd.tar.gz | |
display config file locations on startup
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 954e289bd4..b3620b81cf 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -373,6 +373,14 @@ home_dir() -> Other -> Other end. +config_files() -> + case init:get_argument(config) of + {ok, Files} -> [filename:absname( + filename:rootname(File, ".config") ++ ".config") || + File <- Files]; + error -> [] + end. + %--------------------------------------------------------------------------- print_banner() -> @@ -398,14 +406,24 @@ print_banner() -> Settings = [{"node", node()}, {"app descriptor", app_location()}, {"home dir", home_dir()}, + {"config file(s)", config_files()}, {"cookie hash", rabbit_misc:cookie_hash()}, {"log", log_location(kernel)}, {"sasl log", log_location(sasl)}, {"database dir", rabbit_mnesia:dir()}, {"erlang version", erlang:system_info(version)}], DescrLen = 1 + lists:max([length(K) || {K, _V} <- Settings]), - Format = "~-" ++ integer_to_list(DescrLen) ++ "s: ~s~n", - lists:foreach(fun ({K, V}) -> io:format(Format, [K, V]) end, Settings), + Format = fun (K, V) -> + io:format("~-" ++ integer_to_list(DescrLen) ++ "s: ~s~n", + [K, V]) + end, + lists:foreach(fun ({"config file(s)" = K, []}) -> + Format(K, ""); + ({"config file(s)" = K, [V0 | Vs]}) -> + Format(K, V0), [Format("", V) || V <- Vs]; + ({K, V}) -> + Format(K, V) + end, Settings), io:nl(). ensure_working_log_handlers() -> |
