… | |
… | |
58 | node connectivity and services, C<8> for debugging messages and C<9> for |
58 | node connectivity and services, C<8> for debugging messages and C<9> for |
59 | tracing messages. |
59 | tracing messages. |
60 | |
60 | |
61 | The default simply logs the message to STDERR. |
61 | The default simply logs the message to STDERR. |
62 | |
62 | |
|
|
63 | =item @AnyEvent::MP::Kernel::WARN |
|
|
64 | |
|
|
65 | All code references in this array are called for every log message, from |
|
|
66 | the default C<$WARN> handler. This is an easy way to tie into the log |
|
|
67 | messages without disturbing others. |
|
|
68 | |
63 | =cut |
69 | =cut |
64 | |
70 | |
65 | our $WARNLEVEL = exists $ENV{PERL_ANYEVENT_MP_WARNLEVEL} ? $ENV{PERL_ANYEVENT_MP_WARNLEVEL} : 5; |
71 | our $WARNLEVEL = exists $ENV{PERL_ANYEVENT_MP_WARNLEVEL} ? $ENV{PERL_ANYEVENT_MP_WARNLEVEL} : 5; |
66 | |
72 | our @WARN; |
67 | our $WARN = sub { |
73 | our $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$//; |