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.387 by root, Sat Oct 1 22:39:29 2011 UTC vs.
Revision 1.388 by root, Sun Oct 2 01:22:01 2011 UTC

1302} 1302}
1303 1303
1304sub log($$;@) { 1304sub log($$;@) {
1305 # only load the big bloated module when we actually are about to log something 1305 # only load the big bloated module when we actually are about to log something
1306 if ($_[0] <= ($VERBOSE || 1)) { # also catches non-numeric levels(!) and fatal 1306 if ($_[0] <= ($VERBOSE || 1)) { # also catches non-numeric levels(!) and fatal
1307 local ($!, $@);
1307 require AnyEvent::Log; # among other things, sets $VERBOSE to 9 1308 require AnyEvent::Log; # among other things, sets $VERBOSE to 9
1308 # AnyEvent::Log overwrites this function 1309 # AnyEvent::Log overwrites this function
1309 goto &log; 1310 goto &log;
1310 } 1311 }
1311 1312
1323 1324
1324 my $logger = [$pkg, $level, $renabled]; 1325 my $logger = [$pkg, $level, $renabled];
1325 1326
1326 our %LOGGER; 1327 our %LOGGER;
1327 $LOGGER{$logger+0} = $logger; 1328 $LOGGER{$logger+0} = $logger;
1329
1330 return unless defined wantarray;
1328 1331
1329 require AnyEvent::Util; 1332 require AnyEvent::Util;
1330 my $guard = AnyEvent::Util::guard (sub { 1333 my $guard = AnyEvent::Util::guard (sub {
1331 # "clean up" 1334 # "clean up"
1332 delete $LOGGER{$logger+0}; 1335 delete $LOGGER{$logger+0};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines