Skip Menu |

This queue is for tickets about the Log-Log4perl-Appender-Fluent CPAN distribution.

Report information
The Basics
Id: 113616
Status: open
Priority: 0/
Queue: Log-Log4perl-Appender-Fluent

People
Owner: DOZZIE [...] cpan.org
Requestors: paultcochrane [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.04
Fixed in: (no value)



Subject: pod-coverage tests failing
The `t/pod-coverage.t` tests are failing and thus the module can't be installed without using the `--notest` option to `cpanm`. The failure output looks like this: t/pod-coverage.t .. 1/1 # Failed test 'Pod coverage on Log::Log4perl::Appender::Fluent' # at /home/cochrane/perl5/perlbrew/perls/perl-5.20.2/lib/site_perl/5.20.2/Test/Pod/Coverage.pm line 133. # Log::Log4perl::Appender::Fluent: requiring 'Log::Log4perl::Appender::Fluent' failed # Looks like you failed 1 test of 1. t/pod-coverage.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests It turns out that `use`-ing the `Log::Log4perl` module fixes part of the issue; the remaining test failures can be patched by adding the relevant POD. The test failures are fixed by the attached patches; if anything can be improved in the patches, please let me know and I'll resubmit. Kind regards, Paul
Subject: 0001-Use-Log-Log4perl-so-that-module-can-be-required.patch
From 7084d34083a12bce26381bcd37f16035780c7c3b Mon Sep 17 00:00:00 2001 From: Paul Cochrane <paul@liekut.de> Date: Fri, 8 Apr 2016 11:33:56 +0200 Subject: [PATCH 1/2] Use Log::Log4perl so that module can be 'required' The pod-coverage tests were failing because the module couldn't be required: Failed test 'Pod coverage on Log::Log4perl::Appender::Fluent' at /home/c/perl5/perlbrew/perls/18.1i/lib/site_perl/5.18.1/Test/Pod/Coverage.pm line 126. Log::Log4perl::Appender::Fluent: requiring 'Log::Log4perl::Appender::Fluent' failed As noted in the `00-load.t` test, `Log::Log4perl` is required by appenders to work correctly and the change implemented here fixes this issue. --- lib/Log/Log4perl/Appender/Fluent.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Log/Log4perl/Appender/Fluent.pm b/lib/Log/Log4perl/Appender/Fluent.pm index 103eddc..74b96db 100644 --- a/lib/Log/Log4perl/Appender/Fluent.pm +++ b/lib/Log/Log4perl/Appender/Fluent.pm @@ -33,6 +33,8 @@ package Log::Log4perl::Appender::Fluent; use warnings; use strict; +# required by appenders to work correctly +use Log::Log4perl; use base qw{Log::Log4perl::Appender}; use Fluent::Logger; use Sys::Hostname; -- 2.1.4
Subject: 0002-Document-the-new-and-log-methods.patch
From 7062b2978a0acb77adeff547e34f7e3eed2ab48e Mon Sep 17 00:00:00 2001 From: Paul Cochrane <paul@liekut.de> Date: Fri, 8 Apr 2016 11:36:21 +0200 Subject: [PATCH 2/2] Document the new() and log() methods Once the pod-coverage test could `require` the module correctly, it found that the `new` and `log` methods weren't documented. This patch adds the missing documentation. --- lib/Log/Log4perl/Appender/Fluent.pm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/Log/Log4perl/Appender/Fluent.pm b/lib/Log/Log4perl/Appender/Fluent.pm index 74b96db..d0e7bae 100644 --- a/lib/Log/Log4perl/Appender/Fluent.pm +++ b/lib/Log/Log4perl/Appender/Fluent.pm @@ -93,6 +93,38 @@ I<tag> has the precedence from these two if both set. =back +=head1 METHODS + +=over + +=item new + +Object constructor. The options mentioned in the L<USAGE> section can be +passed to the constructor at object instantiation. + +=item log + +Log messages in a given category and at a given log notification level. + +=over + +=item message + +The message to log. + +=item log4p_category + +The C<Log::Log4perl> category for which this message should be logged. + +=item log4p_level + +The C<Log::Log4perl> notification level for which this message should be +logged, e.g. C<DEBUG>, C<WARNING>, C<ERROR> etc. + +=back + +=back + =cut sub new { -- 2.1.4
Thank you for the report. I'll take a look tomorrow or on Sunday.
Please don't allow pod, critic or kwalitee tests to run for normal user installs, as they make the installation fail unnecessarily when newer versions of the tester module introduces errors that you cannot anticipate. Also spelling tests are dependent on what dictionaries are installed locally, and critic tests use all plugins that are installed, both of which cannot be predicted in advance. Either move them to xt/, or guard them with: plan skip_all => "These tests are for authors only!" unless $ENV{AUTHOR_TESTING} or $ENV{RELEASE_TESTING};