diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-06-01 19:58:01 -0500 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-06-01 19:58:01 -0500 |
commit | 56fe234db26a314ca0b5c45e79f616136cf511cc (patch) | |
tree | b50eea9f64891a8e89198efda1f4dbcd0c39527f | |
parent | e09be186c10c113040fd984fa27cbda5581eef0f (diff) | |
parent | 5c78f96c415de37760839e608794c57f41c1a695 (diff) |
Merge pull request #499 from rebar/handle-custom-logger-breakage
Handle custom logger shell breakage
-rw-r--r-- | src/rebar_prv_shell.erl | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/rebar_prv_shell.erl b/src/rebar_prv_shell.erl index bd49ee1..e407ff2 100644 --- a/src/rebar_prv_shell.erl +++ b/src/rebar_prv_shell.erl @@ -111,12 +111,18 @@ setup_shell() -> %% liveness check. _ = [catch erlang:group_leader(whereis(user), Pid) || Pid <- NeedsUpdate, is_process_alive(Pid)], - %% enable error_logger's tty output - ok = error_logger:swap_handler(tty), - %% disable the simple error_logger (which may have been added multiple - %% times). removes at most the error_logger added by init and the - %% error_logger added by the tty handler - ok = remove_error_handler(3). + try + %% enable error_logger's tty output + error_logger:swap_handler(tty), + %% disable the simple error_logger (which may have been added multiple + %% times). removes at most the error_logger added by init and the + %% error_logger added by the tty handler + remove_error_handler(3) + catch + E:R -> % may fail with custom loggers + ?DEBUG("Logger changes failed for ~p:~p (~p)", [E,R,erlang:get_stacktrace()]), + hope_for_best + end. setup_paths(State) -> %% Add deps to path |