ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/MP/Kernel.pm
(Generate patch)

Comparing AnyEvent-MP/MP/Kernel.pm (file contents):
Revision 1.43 by root, Sat Sep 5 22:48:27 2009 UTC vs.
Revision 1.44 by root, Sun Sep 6 00:13:21 2009 UTC

58node connectivity and services, C<8> for debugging messages and C<9> for 58node connectivity and services, C<8> for debugging messages and C<9> for
59tracing messages. 59tracing messages.
60 60
61The default simply logs the message to STDERR. 61The default simply logs the message to STDERR.
62 62
63=item @AnyEvent::MP::Kernel::WARN
64
65All code references in this array are called for every log message, from
66the default C<$WARN> handler. This is an easy way to tie into the log
67messages without disturbing others.
68
63=cut 69=cut
64 70
65our $WARNLEVEL = exists $ENV{PERL_ANYEVENT_MP_WARNLEVEL} ? $ENV{PERL_ANYEVENT_MP_WARNLEVEL} : 5; 71our $WARNLEVEL = exists $ENV{PERL_ANYEVENT_MP_WARNLEVEL} ? $ENV{PERL_ANYEVENT_MP_WARNLEVEL} : 5;
66 72our @WARN;
67our $WARN = sub { 73our $WARN = sub {
74 &$_ for @WARN;
75
68 return if $WARNLEVEL < $_[0]; 76 return if $WARNLEVEL < $_[0];
69 77
70 my ($level, $msg) = @_; 78 my ($level, $msg) = @_;
71 79
72 $msg =~ s/\n$//; 80 $msg =~ s/\n$//;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines