summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinz N. Gies <heinz@licenser.net>2015-11-04 18:21:00 +0100
committerHeinz N. Gies <heinz@licenser.net>2015-11-04 18:21:00 +0100
commit42695b42b171075b0b349a1e73688dbc19106dc1 (patch)
treedd6a26e9545b97dc18e849fad3b38a2588b60b6f
parentafd2b9b4fb2f7151a0eae1f2be876b05e7544a17 (diff)
Allow switching based on env variable
-rw-r--r--src/rebar_log.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rebar_log.erl b/src/rebar_log.erl
index 781da62..d921110 100644
--- a/src/rebar_log.erl
+++ b/src/rebar_log.erl
@@ -37,6 +37,7 @@
-define(WARN_LEVEL, 1).
-define(INFO_LEVEL, 2).
-define(DEBUG_LEVEL, 3).
+-define(DFLT_INTENSITY, low).
%% ===================================================================
%% Public API
@@ -49,7 +50,15 @@ init(Caller, Verbosity) ->
?INFO_LEVEL -> info;
?DEBUG_LEVEL -> debug
end,
- Log = ec_cmd_log:new(Level, Caller, low),
+ Intensity = case os:getenv("REBAR_COLOR") of
+ "high" ->
+ high;
+ "low" ->
+ low;
+ _ ->
+ ?DFLT_INTENSITY
+ end,
+ Log = ec_cmd_log:new(Level, Caller, Intensity),
application:set_env(rebar, log, Log).
set_level(Level) ->