[erlang-questions] How to see debug messages of

Jachym Holecek <>
Sat Sep 24 20:17:36 CEST 2011


# Allen Kim 2011-09-24:
> I m having some issues of having 1% of  httpc:request/4 ends up with
> {error, socket_closed_remotely}, 99 % are good with 200.
> 
> I want to debug what's happening inside and I saw there are debug message
> already in code.
> 
> What should I do to see those ?hcrd/2 messages?

The macro ends up defined in terms of do-nothing inets:report_event/4
function -- its only purpose is to serve as target for native tracing
facility built into BEAM (and exposed to user via dbg(3) module).

There seem to be a couple of convenience functions that should make
the whole process much more user-friendly than raw dbg(3) API:

  -export([enable_trace/2, enable_trace/3, disable_trace/0, set_trace/1, 
           report_event/4]).

Hopefully this should get you started -- I'm not using httpc(3) at all
and won't pretend to be very fluent with dbg(3) either.

BR,
	-- Jachym



More information about the erlang-questions mailing list