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

Comparing AnyEvent/lib/AnyEvent.pm (file contents):
Revision 1.379 by root, Fri Aug 26 18:09:04 2011 UTC vs.
Revision 1.380 by root, Thu Sep 1 04:07:18 2011 UTC

1058If L<AnyEvent::Log> is not loaded then this function makes a simple test 1058If L<AnyEvent::Log> is not loaded then this function makes a simple test
1059to see whether the message will be logged. If the test succeeds it will 1059to see whether the message will be logged. If the test succeeds it will
1060load AnyEvent::Log and call C<AnyEvent::Log::log> - consequently, look at 1060load AnyEvent::Log and call C<AnyEvent::Log::log> - consequently, look at
1061the L<AnyEvent::Log> documentation for details. 1061the L<AnyEvent::Log> documentation for details.
1062 1062
1063If the test fails it will simply return. 1063If the test fails it will simply return. Right now this happens when a
1064numerical loglevel is used and it is larger than the level specified via
1065C<$ENV{PERL_ANYEVENT_VERBOSE}>.
1064 1066
1065If you want to sprinkle loads of logging calls around your code, consider 1067If you want to sprinkle loads of logging calls around your code, consider
1066creating a logger callback with the C<AnyEvent::Log::logger> function, 1068creating a logger callback with the C<AnyEvent::Log::logger> function,
1067which can reduce typing, codesize and can reduce the logging overhead 1069which can reduce typing, codesize and can reduce the logging overhead
1068enourmously. 1070enourmously.
1256 for grep s/^AE_// && !exists $ENV{"PERL_ANYEVENT_$_"}, keys %ENV; 1258 for grep s/^AE_// && !exists $ENV{"PERL_ANYEVENT_$_"}, keys %ENV;
1257 1259
1258 @ENV{grep /^PERL_ANYEVENT_/, keys %ENV} = () 1260 @ENV{grep /^PERL_ANYEVENT_/, keys %ENV} = ()
1259 if ${^TAINT}; 1261 if ${^TAINT};
1260 1262
1261 $VERBOSE = $ENV{PERL_ANYEVENT_VERBOSE}*1; 1263 $VERBOSE = length $ENV{PERL_ANYEVENT_VERBOSE} ? $ENV{PERL_ANYEVENT_VERBOSE}*1 : 3;
1262} 1264}
1263 1265
1264our $MAX_SIGNAL_LATENCY = 10; 1266our $MAX_SIGNAL_LATENCY = 10;
1265 1267
1266our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred 1268our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred
2040 2042
2041=over 4 2043=over 4
2042 2044
2043=item C<PERL_ANYEVENT_VERBOSE> 2045=item C<PERL_ANYEVENT_VERBOSE>
2044 2046
2045By default, AnyEvent will be completely silent except in fatal 2047By default, AnyEvent will only log messages with loglevel C<3>
2046conditions. You can set this environment variable to make AnyEvent more 2048(C<critical>) or higher (see L<AnyEvent::Log>). You can set this
2049environment variable to a numerical loglevel to make AnyEvent more (or
2050less) talkative.
2051
2047talkative. If you want to do more than just set the global logging level 2052If you want to do more than just set the global logging level
2048you should have a look at C<PERL_ANYEVENT_LOG>, which allows much more 2053you should have a look at C<PERL_ANYEVENT_LOG>, which allows much more
2049complex specifications. 2054complex specifications.
2050 2055
2056When set to C<0> (C<off>), then no messages whatsoever will be logged with
2057the default logging settings.
2058
2051When set to C<5> or higher (warn), causes AnyEvent to warn about unexpected 2059When set to C<5> or higher (C<warn>), causes AnyEvent to warn about
2052conditions, such as not being able to load the event model specified by 2060unexpected conditions, such as not being able to load the event model
2053C<PERL_ANYEVENT_MODEL>, or a guard callback throwing an exception - this 2061specified by C<PERL_ANYEVENT_MODEL>, or a guard callback throwing an
2054is the minimum recommended level. 2062exception - this is the minimum recommended level.
2055 2063
2056When set to C<7> or higher (info), cause AnyEvent to report which event model it 2064When set to C<7> or higher (info), cause AnyEvent to report which event model it
2057chooses. 2065chooses.
2058 2066
2059When set to C<8> or higher (debug), then AnyEvent will report extra information on 2067When set to C<8> or higher (debug), then AnyEvent will report extra information on

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines