diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2018-05-02 23:40:35 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2018-05-03 07:18:11 -0400 |
commit | 50dfdfddc2c19fbf8ff44ff981ed7e0ed37b26d4 (patch) | |
tree | a1502f54c672c93ce25e6baf05c1868b57349f9a /src | |
parent | 5f9b4293bc029e2132d7c442cb5b4480915ea0e4 (diff) |
Confirm lack of regressions on new logger in shell
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_shell.erl | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/rebar_prv_shell.erl b/src/rebar_prv_shell.erl index d62f1bc..9a320ad 100644 --- a/src/rebar_prv_shell.erl +++ b/src/rebar_prv_shell.erl @@ -201,21 +201,28 @@ rewrite_leaders(OldUser, NewUser) -> lists:member(proplists:get_value(group_leader, erlang:process_info(Pid)), OldMasters)], 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), - %% reset the tty handler once more for remote shells - error_logger:swap_handler(tty) + case erlang:function_exported(logger, module_info, 0) of + false -> + %% Old style logger had a lock-up issue and other problems related + %% to group leader handling. + %% 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), + %% reset the tty handler once more for remote shells + error_logger:swap_handler(tty); + true -> + %% This is no longer a problem with the logger interface + ok + end catch ?WITH_STACKTRACE(E,R,S) % may fail with custom loggers ?DEBUG("Logger changes failed for ~p:~p (~p)", [E,R,S]), hope_for_best end. - setup_paths(State) -> %% Add deps to path code:add_pathsa(rebar_state:code_paths(State, all_deps)), |