diff options
author | Björn Gustavsson <[email protected]> | 2015-08-20 09:44:43 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-09-07 10:35:32 +0200 |
commit | 7dbd3caa955ad9da7c1da97cee9d53a311b26908 (patch) | |
tree | c6b7646c7ecff7e8e56501b3db5324fab1c206d9 /lib/stdlib/src | |
parent | 7e5c215b3ee06f4f425f45b4c28fe66b3c987bca (diff) | |
download | otp-7dbd3caa955ad9da7c1da97cee9d53a311b26908.tar.gz otp-7dbd3caa955ad9da7c1da97cee9d53a311b26908.tar.bz2 otp-7dbd3caa955ad9da7c1da97cee9d53a311b26908.zip |
Remove unused code in error logger handlers
A long time ago, errors from the emulator itself was sent as
messages that would end up in the handle_info/2 function.
Those clauses in handle_info/2 can be removed.
The code for handling events tagged 'info' instead of 'info_msg'
can also be taken out.
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/error_logger_file_h.erl | 24 | ||||
-rw-r--r-- | lib/stdlib/src/error_logger_tty_h.erl | 23 |
2 files changed, 4 insertions, 43 deletions
diff --git a/lib/stdlib/src/error_logger_file_h.erl b/lib/stdlib/src/error_logger_file_h.erl index a7f3615972..bf74ad28bb 100644 --- a/lib/stdlib/src/error_logger_file_h.erl +++ b/lib/stdlib/src/error_logger_file_h.erl @@ -24,12 +24,10 @@ %%% %%% A handler that can be connected to the error_logger -%%% event handler. -%%% Writes all events formatted to file. -%%% Handles events tagged error, emulator and info. +%%% event handler. Writes all events formatted to file. %%% %%% It can only be started from error_logger:swap_handler({logfile, File}) -%%% or error_logger:logfile(File) +%%% or error_logger:logfile(File). %%% -export([init/1, @@ -73,13 +71,6 @@ handle_info({'EXIT', Fd, _Reason}, {Fd, _File, PrevHandler}) -> _ -> {swap_handler, install_prev, [], PrevHandler, go_back} end; -handle_info({emulator, GL, Chars}, {Fd, File, PrevHandler}) - when node(GL) == node() -> - write_event(Fd, tag_event({emulator, GL, Chars})), - {ok, {Fd, File, PrevHandler}}; -handle_info({emulator, noproc, Chars}, {Fd, File, PrevHandler}) -> - write_event(Fd, tag_event({emulator, noproc, Chars})), - {ok, {Fd, File, PrevHandler}}; handle_info(_, State) -> {ok, State}. @@ -124,17 +115,6 @@ write_event(Fd, {Time, {error, _GL, {Pid, Format, Args}}}) -> F = add_node("ERROR: ~p - ~p~n", Pid), io:format(Fd, T ++ F, [Format,Args]) end; -write_event(Fd, {Time, {emulator, _GL, Chars}}) -> - T = write_time(maybe_utc(Time)), - case catch io_lib:format(Chars, []) of - S when is_list(S) -> - io:format(Fd, T ++ S, []); - _ -> - io:format(Fd, T ++ "ERROR: ~p ~n", [Chars]) - end; -write_event(Fd, {Time, {info, _GL, {Pid, Info, _}}}) -> - T = write_time(maybe_utc(Time)), - io:format(Fd, T ++ add_node("~p~n",Pid),[Info]); write_event(Fd, {Time, {error_report, _GL, {Pid, std_error, Rep}}}) -> T = write_time(maybe_utc(Time)), S = format_report(Rep), diff --git a/lib/stdlib/src/error_logger_tty_h.erl b/lib/stdlib/src/error_logger_tty_h.erl index 65ea645bd9..5307dac6d0 100644 --- a/lib/stdlib/src/error_logger_tty_h.erl +++ b/lib/stdlib/src/error_logger_tty_h.erl @@ -23,12 +23,10 @@ %%% %%% A handler that can be connected to the error_logger -%%% event handler. -%%% Writes all events formatted to stdout. -%%% Handles events tagged error, emulator and info. +%%% event handler. Writes all events formatted to stdout. %%% %%% It can only be started from error_logger:swap_handler(tty) -%%% or error_logger:tty(true) +%%% or error_logger:tty(true). %%% -export([init/1, @@ -66,12 +64,6 @@ handle_info({'EXIT', User, _Reason}, {User, PrevHandler}) -> {swap_handler, install_prev, {User, PrevHandler}, PrevHandler, go_back} end; -handle_info({emulator, GL, Chars}, State) when node(GL) == node() -> - ok = write_event(tag_event({emulator, GL, Chars}),io), - {ok, State}; -handle_info({emulator, noproc, Chars}, State) -> - ok = write_event(tag_event({emulator, noproc, Chars}),io), - {ok, State}; handle_info(_, State) -> {ok, State}. @@ -118,17 +110,6 @@ write_event({Time, {error, _GL, {Pid, Format, Args}}},IOMod) -> F = add_node("ERROR: ~p - ~p~n", Pid), format(IOMod, T ++ F, [Format,Args]) end; -write_event({Time, {emulator, _GL, Chars}},IOMod) -> - T = write_time(maybe_utc(Time)), - case catch io_lib:format(Chars, []) of - S when is_list(S) -> - format(IOMod, T ++ S); - _ -> - format(IOMod, T ++ "ERROR: ~p ~n", [Chars]) - end; -write_event({Time, {info, _GL, {Pid, Info, _}}},IOMod) -> - T = write_time(maybe_utc(Time)), - format(IOMod, T ++ add_node("~p~n",Pid),[Info]); write_event({Time, {error_report, _GL, {Pid, std_error, Rep}}},IOMod) -> T = write_time(maybe_utc(Time)), S = format_report(Rep), |