houseabsolute / Log-Dispatch

Dispatches messages to one or more outputs
https://metacpan.org/release/Log-Dispatch/
Other
12 stars 29 forks source link

Log::Dispatch complains about _should_log during global destruction. #47

Closed giganteous closed 7 years ago

giganteous commented 7 years ago

rt-crontool from bestpractical uses Log::Dispatch which complains occasionally about this:

    (in cleanup) Can't call method "_should_log" on an undefined value at /usr/share/perl5/Log/Dispatch.pm line 269 during global destruction.

That line:

262 sub would_log {
263     my $self  = shift;
264     my $level = shift;
265 
266     return 0 unless $self->level_is_valid($level);
267 
268     foreach ( values %{ $self->{outputs} } ) {
269         return 1 if $_->_should_log($level);                                                                                
270     }
271 
272     return 0;
273 }

I'm using version 2.44, supplied to me by my vendor Debian. Is this a bug?

Regards, Kai

autarch commented 7 years ago

This is a bug in the rt-crontool code, please report it there. You cannot rely on objects existing during global destruction.