yaws

Kenneth Lundin <>
Tue Jun 4 12:39:18 CEST 2002


Bengt Kleberg wrote:
> 
> > From: "Bruce Fitzsimons" <>
> > To: "Klacke" <>, <>
> > Subject: Re: yaws
> 
> > Have you every thought about run-time switchable debug? Probably not
> > amazingly useful for this situation, but I've found it very useful in
> 
> what about the dbg module? it works on a production system, without
> recompilation. (or is this module internal to ericsson?)
> 
> bengt

The trace support in Erlang is very good, and a lot of new features have
been added in the recent releases. The interface for activating trace is
in the
dbg module. A new feature that Klacke might not be very familiar with is
the function call trace very you can trace on both local and exported
functions
in selected modules and for selected processes (or all). The trace
output
can be directed to different trace ports which either stores on disc or
send to a socket. With these trace capabilities all types of debug
macros
can be removed. If you want specific information at certain points just
call a dummy function like this:

...
my_debug:info(Var1,Var2,Var3,,VarN),
...


Implement info/N like this:

info(Var1,Var2,Var3,VarN) ->
	true.


Then if you want to activate tracing dynamically just specify tracing on 
my_debug:info/N.

The call to info is very cheap, i.e acceptable to have in production
code.
The possibility to trace on functions does not cost anything extra when
not used
and is very efficient when used.

Of course you can trace on all the other functions too if you like.
There is no need
to call specific debug functions like the 'info' above. 

The trace features are not specific for Ericsson, they are available in
the Open Source
Erlang. The tracing is however very much used within Ericsson , it is
designed
specifically to be useful in a live production system and even possible
to use
at customer site if necessary. Of course you can load the system to it's
nees
if you select tracing on all function calls and the trace output will
soon fill 
up your disc, so you have to a bit careful.

Regards Kenneth Lundin (Product Manager for Erlang/OTP within Ericsson)



More information about the erlang-questions mailing list