diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2013-12-03 19:59:28 +0100 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2013-12-06 19:05:45 +0100 |
commit | f39309a66020e13892350785bf3feff6907c5ee6 (patch) | |
tree | 3364f47f5e0c42d8b08a7bdf412609e9eef99c9d /src | |
parent | 6de94e8a166bcf4f82d799cf8f208d39babed415 (diff) |
Write ERROR messages to standard_error device
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_log.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rebar_log.erl b/src/rebar_log.erl index 300a615..8be090b 100644 --- a/src/rebar_log.erl +++ b/src/rebar_log.erl @@ -30,7 +30,8 @@ set_level/1, error_level/0, default_level/0, - log/3]). + log/3, + log/4]). -define(ERROR_LEVEL, 0). -define(WARN_LEVEL, 1). @@ -54,10 +55,13 @@ set_level(Level) -> ok = application:set_env(rebar, log_level, Level). log(Level, Str, Args) -> + log(standard_io, Level, Str, Args). + +log(Device, Level, Str, Args) -> {ok, LogLevel} = application:get_env(rebar, log_level), case should_log(LogLevel, Level) of true -> - io:format(log_prefix(Level) ++ Str, Args); + io:format(Device, log_prefix(Level) ++ Str, Args); false -> ok end. |