Permalink
Browse files

Add support for 'erl -embedded' application env var-style config

  • Loading branch information...
1 parent 3311789 commit 7a0122cb4dbaaaaf59678974950493f78a10a093 @slfritchie slfritchie committed Nov 4, 2010
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/riak_err_handler.erl
View
12 src/riak_err_handler.erl
@@ -241,9 +241,17 @@ sasl_limited_str(progress, Report, #state{fmt_max_bytes = FmtMaxBytes}) ->
sasl_limited_str(crash_report, Report, #state{fmt_max_bytes = FmtMaxBytes}) ->
riak_err_stdlib:proc_lib_format(Report, FmtMaxBytes).
-get_int_env(Name, Default) when is_atom(Name) ->
- get_int_env(atom_to_list(Name), Default);
get_int_env(Name, Default) ->
+ case application:get_env(riak_err, Name) of
+ {ok, Val} ->
+ Val;
+ _ ->
+ get_int_env2(Name, Default)
+ end.
+
+get_int_env2(Name, Default) when is_atom(Name) ->
+ get_int_env2(atom_to_list(Name), Default);
+get_int_env2(Name, Default) ->
case init:get_argument(riak_err) of
{ok, ListOfLists} ->
find_int_in_pairs(lists:append(ListOfLists), Name, Default);

0 comments on commit 7a0122c

Please sign in to comment.