|
|
| Author |
Message |
< Erlang patches mailing list ~ odbc and ssl applications use error_logger:error_report/2 in |
| mdempsky |
Posted: Sun Apr 06, 2008 7:24 pm |
|
|
|
User
Joined: 24 Sep 2007
Posts: 118
|
While looking for idiomatic uses of error_logger:error_report in the
OTP distribution, I noticed that the odbc and ssl applications call
error_logger:error_report/2 with arguments that look intended for
error_logger:error_msg/2. The patch below corrects this.
--- odbc/src/odbc.erl.orig 2008-04-05 21:00:25.000000000 -0700
+++ odbc/src/odbc.erl 2008-04-05 21:01:03.000000000 -0700
@@ -678,8 +678,8 @@
ok ->
ok;
{error, Reason} ->
- error_logger:error_report("ODBC could not end connection "
- "gracefully due to ~p~n", [Reason])
+ error_logger:error_msg("ODBC could not end connection "
+ "gracefully due to ~p~n", [Reason])
end,
{stop, normal, State#state{reply_to = undefined}};
@@ -754,8 +754,7 @@
%% so we do not want to crash, but we make a log entry as it is an
%% unwanted behaviour.)
handle_info(Info, State) ->
- error_logger:error_report("ODBC: received unexpected info: ~p~n",
- [Info]),
+ error_logger:error_msg("ODBC: received unexpected info: ~p~n", [Info]),
{noreply, State}.
%%--------------------------------------------------------------------------
--- ssl/src/ssl_handshake.erl.orig 2008-04-05 21:05:12.000000000 -0700
+++ ssl/src/ssl_handshake.erl 2008-04-05 21:05:52.000000000 -0700
@@ -274,8 +274,8 @@
Result
catch
exit:Reason ->
- error_logger:error_report("Key calculation failed due to ~p",
- [Reason]),
+ error_logger:error_msg("Key calculation failed due to ~p~n",
+ [Reason]),
#alert{level = ?FATAL, description = ?HANDSHAKE_FAILURE}
end;
@@ -294,8 +294,8 @@
catch
exit:Reason ->
- error_logger:error_report("Master secret calculation failed"
- " due to ~p", [Reason]),
+ error_logger:error_msg("Master secret calculation failed"
+ " due to ~p~n", [Reason]),
#alert{level = ?FATAL, description = ?HANDSHAKE_FAILURE}
end.
_______________________________________________
erlang-patches mailing list
erlang-patches@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-patches
Post recived from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|