On Fri Jul 13 16:51:47 2018, GREGOA wrote:
Show quoted text> We have the following bug reported to the Debian package of
> Log-Handler (
https://bugs.debian.org/903741):
>
> It doesn't seem to be a bug in the packaging, so you may want to take
> a look. Thanks!
>
> ------8<-----------8<-----------8<-----------8<-----------8<-----
>
> Package: liblog-handler-perl
> Version: 0.88-1
> User: debian-perl@lists.debian.org
> Usertags: perl-5.28-transition
>
> While test rebuilding the archive against Perl 5.28 (currently in
> experimental), we noticed this warning in the build log of this
> package:
>
> hostname() doesn't accept any arguments. This will become fatal in
> Perl 5.32 at /<<PKGBUILDDIR>>/blib/lib/Log/Handler/Output.pm line 67.
>
> A full build log can be found at
>
>
http://perl.debian.net/rebuild-logs/perl-5.28-throwaway/liblog-
> handler-perl_0.88-1/liblog-handler-perl_0.88-1_amd64-2018-06-
> 05T14%3A42%3A03Z.build
Please review the patch attached.
Thank you very much.
Jim Keenan
diff -u -r ./lib/Log/Handler/Output.pm /home/jkeenan/Downloads/Log-Handler-0.88/lib/Log/Handler/Output.pm
--- ./lib/Log/Handler/Output.pm 2015-06-15 22:15:10.000000000 -0400
+++ /home/jkeenan/Downloads/Log-Handler-0.88/lib/Log/Handler/Output.pm 2019-07-16 15:33:43.199901580 -0400
@@ -64,7 +64,12 @@
# is that each output can have their own time/date format
# and the code which is executed can return another value.
foreach my $r (@{$self->{wanted_pattern}}) {
- $wanted->{$r->{name}} = &{$r->{code}}($self, $level);
+ unless ($r->{name} eq 'hostname') {
+ $wanted->{$r->{name}} = &{$r->{code}}($self, $level);
+ }
+ else {
+ $wanted->{$r->{name}} = $r->{code}();
+ }
}
if ($self->{message_pattern}) {
diff -u -r ./t/012-handler-message-pattern.t /home/jkeenan/Downloads/Log-Handler-0.88/t/012-handler-message-pattern.t
--- ./t/012-handler-message-pattern.t 2013-11-03 14:27:58.000000000 -0500
+++ /home/jkeenan/Downloads/Log-Handler-0.88/t/012-handler-message-pattern.t 2019-07-16 15:30:13.203358617 -0400
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 15;
+use Test::More tests => 17;
use Log::Handler;
my $CHECKED = 0;
@@ -34,7 +34,10 @@
my $log = Log::Handler->new();
-$log->add(
+ok(defined $log, "new() returned defined object");
+isa_ok($log, 'Log::Handler');
+
+my $rv = $log->add(
forward => {
forward_to => \&check_struct,
maxlevel => 'debug',
@@ -44,7 +47,7 @@
}
);
-ok(1, 'new');
+ok($rv, "add() returned true value");
$log->debug('foo');