- or download this
package Foo;
use strict;
...
return unless exists $self->{LOGGER};
$self->{LOGGER}->debug(@_);
}
- or download this
my $logger = SomeOtherLogger->new(log_level => 'debug');
my $foo = Foo->new(LOGGER => $logger);
- or download this
use Scalar::Util qw( blessed );
sub debug {
...
$self->{LOGGER}->debug(@_);
}