Erlang/OTP Forums

Author Message

<  Erlang patches mailing list  ~  odbc and ssl applications use error_logger:error_report/2 in

Guest
Posted: Mon Apr 07, 2008 6:53 am Reply with quote
Guest
Hi!

Thank you for reporting this. Indeed there needs to be a change in the code.
I have created a ticket for this.

Regards Ingela - OTP team

Matthew Dempsky wrote:
> 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
>
>

_______________________________________________
erlang-patches mailing list
erlang-patches@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-patches
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

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