--- AnyEvent-MP/MP/LogCatcher.pm 2009/09/06 00:13:21 1.1 +++ AnyEvent-MP/MP/LogCatcher.pm 2009/09/07 18:42:09 1.4 @@ -48,8 +48,6 @@ if $_[0] <= $loglevel; }; - rcv $SELF, sub { };#d# - push @AnyEvent::MP::Kernel::WARN, $cb; # monitor them, silently die @@ -76,14 +74,24 @@ }; # establish connection - my $rport = spawn $node, "AnyEvent::MP::LogCatcher::connect", 0, $lport, $LOGLEVEL; + AnyEvent::MP::Kernel::snd_to_func $node, "AnyEvent::MP::LogCatcher::connect", 0, $lport, $LOGLEVEL; - mon $rport, $lport; - mon $lport, sub { - warn "$lport $rport <@_>\n";#d# - }; + mon $node, $lport; } +=item AnyEvent::MP::LogCatcher::catch [$level] + +Starts catching all log messages from all nodes with level C<$level> or +lower. If the C<$level> is C, then stop catching all messages +again. + +Example: start a node that catches all messages (you might have to specify +a suitable profile name). + + aemp run profilename services '[["AnyEvent::MP::LogCatcher::catch",9]]' + +=cut + sub catch { $LOGLEVEL = $_[0]; kil $_, "restart" for values %lport;