Przeglądaj źródła

Use an app_env to get color intensity

pull/902/head
Heinz N. Gies 9 lat temu
rodzic
commit
c79fe4cf1b
1 zmienionych plików z 17 dodań i 7 usunięć
  1. +17
    -7
      src/rebar_log.erl

+ 17
- 7
src/rebar_log.erl Wyświetl plik

@ -30,6 +30,7 @@
set_level/1,
error_level/0,
default_level/0,
intensity/0,
log/3,
is_verbose/1]).
@ -43,14 +44,23 @@
%% Public API
%% ===================================================================
%% @doc Returns the color intensity, we first check the application envorinment
%% if that is not set we check the environment variable REBAR_COLOR.
intensity() ->
case os:getenv("REBAR_COLOR") of
"high" ->
high;
"low" ->
low;
_ ->
?DFLT_INTENSITY
case application:get_env(rebar, color_intensity) of
undefined ->
R = case os:getenv("REBAR_COLOR") of
"high" ->
high;
"low" ->
low;
_ ->
?DFLT_INTENSITY
end,
application:set_env(rebar, color_intensity, R),
R;
{ok, Mode} ->
Mode
end.
init(Caller, Verbosity) ->

Ładowanie…
Anuluj
Zapisz