[erlang-bugs] gen_event:notify unexpected behavior

mog mog-lists@REDACTED
Sat Apr 26 08:13:46 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I recently started playing with the gen_event module, in hopes of
using it in my program for some optional debugging.  Some of the time
I would like to turn on an event handler that prints out all the
incoming packets, the majority of the time I would just like it off as
I would not like to inure the penalty of copying the packets or a
description of them all the time only when debugging.  The
documentation says that gen_event:notify always returns ok, but this
is not the case.

 gen_event:notify(debug,"test").
** exception error: bad argument
     in function  gen_event:send/2


any of the other options except for the pid option also return an
error if the handler is not started.

Passing a pid does do what I want in that it returns very quickly,
however I would like to have named handlers as they are easier to deal
with.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIEsfieq+tARrxhnsRAkg7AJ9xB1SO23jUPhR4mJveeroY8fZcXgCdEz+a
LwgswouBNKHMF0Zwxg1P5fg=
=rs9+
-----END PGP SIGNATURE-----




More information about the erlang-bugs mailing list