is there /dev/null process in Erlang ?

Trap Exit <>
Fri Jul 21 10:43:42 CEST 2006


Have you thougth of using Macros, or is this output buffer something you would like to change in run-time?

A macro solution could look like this:

-define&#40;debug_2_stdout, ok&#41;.

-ifdef&#40;debug_2_file&#41;.
&nbsp; &nbsp; -define&#40;DBGOUT&#40;String, Values&#41;, io&#58;format&#40;ios, String, Values&#41;&#41;.
-else.
&nbsp; &nbsp; -ifdef&#40;debug_2_stdout&#41;.
&nbsp; &nbsp; &nbsp; &nbsp; -define&#40;DBGOUT&#40;String, Values&#41;, io&#58;format&#40;String, Values&#41;&#41;.
&nbsp; &nbsp; -else.
&nbsp; &nbsp; &nbsp; &nbsp; -define&#40;DBGOUT&#40;String, Values&#41;, ok&#41;.
&nbsp; &nbsp; -endif.
-endif.

test&#40;&#41; ->
&nbsp; &nbsp; ?DBGOUT&#40;"Test&#58; ~pn", &#91;data&#93;&#41;.

_________________________________________________________
Post sent from http://www.trapexit.org



More information about the erlang-questions mailing list