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

Comparing AnyEvent/lib/AnyEvent/Log.pm (file contents):
Revision 1.16 by root, Sat Aug 20 02:19:18 2011 UTC vs.
Revision 1.17 by root, Sat Aug 20 02:21:53 2011 UTC

278 278
279our %LOGGER; 279our %LOGGER;
280 280
281# re-assess logging status for all loggers 281# re-assess logging status for all loggers
282sub _reassess { 282sub _reassess {
283 local $SIG{__DIE__};
284 my $die = sub { die };
285
283 for (@_ ? $LOGGER{$_[0]} : values %LOGGER) { 286 for (@_ ? $LOGGER{$_[0]} : values %LOGGER) {
284 my ($ctx, $level, $renabled) = @$_; 287 my ($ctx, $level, $renabled) = @$_;
285 288
286 # to detect whether a message would be logged, we # actually 289 # to detect whether a message would be logged, we actually
287 # try to log one and die. this isn't fast, but we can be 290 # try to log one and die. this isn't fast, but we can be
288 # sure that the logging decision is correct :) 291 # sure that the logging decision is correct :)
289 292
290 $$renabled = !eval { 293 $$renabled = !eval {
291 local $SIG{__DIE__};
292
293 _log $ctx, $level, sub { die }; 294 _log $ctx, $level, $die;
294 295
295 1 296 1
296 }; 297 };
297
298 $$renabled = 1; # TODO
299 } 298 }
300} 299}
301 300
302sub _logger { 301sub _logger {
303 my ($ctx, $level, $renabled) = @_; 302 my ($ctx, $level, $renabled) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines