Erlang io:format, and a hanging web application?

In Erlang, as in other languages, you can print your variables, no matter if they are a list, a tuple or anything else.

In Erlang, as in other languages, you can print your variables, no matter if they are a list, a tuple or anything else. My feeling is that, for printing, you're doing something like (just a guess): io:format("The value is: ~p. ", A).

This is wrong, because you're supposed to pass a list of arguments: io:format("The value is: ~p. ", A). Where A can be anything.

I usually find comfortable to use: erlang:display/1 to print variables. Also, tracing functions is usually a better way to debug an application, rather than using printouts. Please see: aloiroberto.wordpress.com/2009/02/23/tra....

When developing webapps I use the error_logger module I usually define some macros like this -ifdef(debug). -define(idbg(FmtStr, Err), error_logger:info_msg("~p (line ~p): " FmtStr "~n",? MODULE,?

LINE | Err)). -define(rdbg(Term), error_logger:info_report(Term)). -else.

-define(idbg(_FmtStr, _Err), void). -define(rdbg(_Term), void). -endif.

You call the macros with something like: code...?rdbg(ErlangTerm), other code... During development you compile your modules with: erlc -Ddebug *. Erl and so you get info messages in your erlang console.

Also make sure that there is no terminating process without link which could then cause other process to wait on something and not timeout-ing - hence strange hanging part.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions