79
|
0 |
0 |
0 |
$LPORT{$node} ||= do {
my $lport = &port(sub {
my($time, $ctx, $level, $msg) = @_;
$level = 2 if $level < 2;
my $diff = &AE::now() - $time;
$diff = abs $diff < 0.001 ? '' : sprintf('%+.3fs', $diff);
local $PROPAGATE;
&AnyEvent::Log::ctx($ctx)->log($level, "[$node$diff] $msg");
}
);
mon($lport, sub {
return unless delete $LPORT{$node};
&AE::log('error', join($", @_)) if @_;
mon_node($node);
}
);
&AnyEvent::MP::Kernel::snd_to_func($node, 'AnyEvent::MP::LogCatcher::connect', 0, $lport, $LOGLEVEL);
mon($node, $lport);
$lport
} |