is there /dev/null process in Erlang ?

Trap Exit trapexit.erlang-questions@REDACTED
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(debug_2_stdout, ok).

-ifdef(debug_2_file).
    -define(DBGOUT(String, Values), io:format(ios, String, Values)).
-else.
    -ifdef(debug_2_stdout).
        -define(DBGOUT(String, Values), io:format(String, Values)).
    -else.
        -define(DBGOUT(String, Values), ok).
    -endif.
-endif.

test() ->
    ?DBGOUT("Test: ~pn", [data]).

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



More information about the erlang-questions mailing list