Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bring up to date with v0.42 from CPAN

  • Loading branch information...
commit 665068fbb60ec04345deb5ad1a62cb5bb155bf70 1 parent cbb8f8c
gardnerm authored
View
40 Changes
@@ -1,22 +1,38 @@
Revision history for MooseX::Log::Log4perl
- Added t/99bench.t for basic benchmark testing
+0.42 Thu Apr 29 2010 (again)
+ * Remove Log::Any from benchmark tests, we want to avoid failing tests
+
+0.41 Thu Apr 29 2010
+ * Added POD::Covergage test (t/podcoverage.t)
+ * Added Perl::Critic test (t/pelr-critic.t)
+ * RT#57021: Raised dependency to Log::Log4perl 1.13 which first introduced the TRACE level (thanks Sam Vilain)
+ * Raise dependency for Moose to 0.65, which has fixes for Win32 Builds
+ * Updated Module::Install to 0.94
+ * Raise required perl version to 5.8
+
+0.40 Sun May 17 2009
+ * #45554: Applied patch for easy method handling for %M pattern by Tim Bunce
+ * Added t/99bench.t for basic benchmark testing
+ * Added load test of ::Easy and diag printing of version numbers to t/00load.t
+ * Updated included Module::Install to 0.88
+ * Improved tests to include %M pattern
+ * Only do the benchmark test for TEST_MAINT is set, otherwise skip
0.31 Mon Jul 21 2008
- Fixed bug reported by Maik Hentsche
+ * Fixed bug reported by Maik Hentsche
0.30 Tue Jul 15 2008
- Corrected MANIFEST (added MANIFEST.SKIP to generate it correctly now)
- Improved pod and fixed typo in MooseX::Log::Log4perl::Easy
- Cleanup of tests and pod
- Repackage as 0.30 to fix failing cpan tests (and fix perl module version numbering for CPAN)
+ * Corrected MANIFEST (added MANIFEST.SKIP to generate it correctly now)
+ * Improved pod and fixed typo in MooseX::Log::Log4perl::Easy
+ * Cleanup of tests and pod
+ * Repackage as 0.30 to fix failing cpan tests (and fix perl module version numbering for CPAN)
0.2 Mon Jul 14 2008
- Added MooseX::Log::Log4perl::Easy for simple log interface
- this adds methods $self->log_error, $self->log_debug, ... for all log levels
- Cleanup of tests and pod
+ * Added MooseX::Log::Log4perl::Easy for simple log interface
+ this adds methods $self->log_error, $self->log_debug, ... for all log levels
+ * Cleanup of tests and pod
0.1 Thu Jul 10 2008
- Initial release with support for log4perl logging. (Roland Lammel)
- Logger init has to be done outside of this package for now.
-
+ * Initial release with support for log4perl logging. (Roland Lammel)
+ * Logger init has to be done outside of this package for now.
View
3  MANIFEST
@@ -20,4 +20,7 @@ t/00load.t
t/01basic.t
t/02easy.t
t/99bench.t
+t/perl-critic.t
+t/perlcriticrc
t/pod.t
+t/podcoverage.t
View
9 META.yml
@@ -9,7 +9,7 @@ build_requires:
configure_requires:
ExtUtils::MakeMaker: 6.42
distribution_type: module
-generated_by: 'Module::Install version 0.88'
+generated_by: 'Module::Install version 0.94'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -20,8 +20,9 @@ no_index:
- inc
- t
requires:
- Log::Log4perl: 0
- Moose: 0
+ Log::Log4perl: 1.13
+ Moose: 0.65
+ perl: 5.8.0
resources:
license: http://dev.perl.org/licenses/
-version: 0.40
+version: 0.41
View
4 Makefile.PL
@@ -6,8 +6,8 @@ all_from 'lib/MooseX/Log/Log4perl.pm';
build_requires 'IO::Scalar';
build_requires 'Test::More';
-requires 'Moose';
-requires 'Log::Log4perl';
+requires 'Moose' => 0.65;
+requires 'Log::Log4perl' => 1.13;
auto_install;
WriteAll;
View
25 lib/MooseX/Log/Log4perl.pm
@@ -1,19 +1,20 @@
package MooseX::Log::Log4perl;
+use 5.008;
use Moose::Role;
use Log::Log4perl;
-our $VERSION = '0.40';
+our $VERSION = '0.42';
has 'logger' => (
is => 'rw',
isa => 'Log::Log4perl::Logger',
lazy => 1,
- default => sub { my $self = shift; return Log::Log4perl->get_logger(ref($self)) }
+ default => sub { return Log::Log4perl->get_logger(ref($_[0])) }
);
sub log {
- return Log::Log4perl->get_logger($_[1]) if ($_[1] && !ref($_[1]));
+ return Log::Log4perl->get_logger($_[1]) if ($_[1] && !ref($_[1]));
return $_[0]->logger;
}
@@ -25,10 +26,6 @@ __END__
MooseX::Log::Log4perl - A Logging Role for Moose based on Log::Log4perl
-=head1 VERSION
-
-This document describes MooseX::Log::Log4perl version 0.30
-
=head1 SYNOPSIS
package MyApp;
@@ -110,11 +107,21 @@ Roland Lammel C<< <lammel@cpan.org> >>
Inspired by the work by Chris Prather C<< <perigrin@cpan.org> >> and Ash
Berlin C<< <ash@cpan.org> >> on L<MooseX::LogDispatch>
-Thanks to Michael Schilli C<< <m@perlmeister.com> >> for L<Log::Log4perl> and suggestions in the interface.
+=head1 CONTRIBUTORS
+
+In alphabetical order:
+
+=over 2
+
+=item Michael Schilli C<< <m@perlmeister.com> >> for L<Log::Log4perl> and suggestions in the interface.
+
+=item Tim Bunce C<< <TIMB@cpan.org> >> for corrections in the L<MooseX::Log::Log4perl::Easy> module.
+
+=back
=head1 LICENCE AND COPYRIGHT
-Copyright (c) 2008-2009, Roland Lammel C<< <lammel@cpan.org> >>, http://www.quikit.at. Some rights reserved.
+Copyright (c) 2008-2010, Roland Lammel C<< <lammel@cpan.org> >>, http://www.quikit.at. Some rights reserved.
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>.
View
24 lib/MooseX/Log/Log4perl/Easy.pm
@@ -4,14 +4,14 @@ use Moose::Role;
with 'MooseX::Log::Log4perl';
-our $VERSION = '0.40';
+our $VERSION = '0.41';
-sub log_fatal { local $Log::Log4perl::caller_depth += 1; shift->logger->fatal(@_); }
-sub log_error { local $Log::Log4perl::caller_depth += 1; shift->logger->error(@_); }
-sub log_warn { local $Log::Log4perl::caller_depth += 1; shift->logger->warn(@_); }
-sub log_info { local $Log::Log4perl::caller_depth += 1; shift->logger->info(@_); }
-sub log_debug { local $Log::Log4perl::caller_depth += 1; shift->logger->debug(@_); }
-sub log_trace { local $Log::Log4perl::caller_depth += 1; shift->logger->trace(@_); }
+sub log_fatal { local $Log::Log4perl::caller_depth += 1; return shift->logger->fatal(@_); }
+sub log_error { local $Log::Log4perl::caller_depth += 1; return shift->logger->error(@_); }
+sub log_warn { local $Log::Log4perl::caller_depth += 1; return shift->logger->warn(@_); }
+sub log_info { local $Log::Log4perl::caller_depth += 1; return shift->logger->info(@_); }
+sub log_debug { local $Log::Log4perl::caller_depth += 1; return shift->logger->debug(@_); }
+sub log_trace { local $Log::Log4perl::caller_depth += 1; return shift->logger->trace(@_); }
1;
@@ -19,11 +19,7 @@ __END__
=head1 NAME
-MooseX::Log::Log4perl::Easy - A Logging Role with easy interface for Moose based on L<MooseX::Log::Log4perl>
-
-=head1 VERSION
-
-This document describes MooseX::Log::Log4perl::Easy version 0.31
+MooseX::Log::Log4perl::Easy - A role for easy usage of logging in your Moose based modules based on L<MooseX::Log::Log4perl>
=head1 SYNOPSIS
@@ -54,7 +50,7 @@ logmethods for all available levels to your class instance. Hence it is possible
without having to access a seperate log attribute as in MooseX::Log::Log4perl;
In case your app grows and you need more of the super-cow powers of Log4perl or simply don't want the additional
-methodes to clutter up your class you can simply replace all code C<< $self->log_LEVEL >> with
+methods to clutter up your class you can simply replace all code C<< $self->log_LEVEL >> with
C<< $self->log->LEVEL >>.
You can use the following regex substitution to accomplish that:
@@ -129,7 +125,7 @@ Contributions from Tim Bunce C<< <TIMB@cpan.org> >>
=head1 LICENCE AND COPYRIGHT
-Copyright (c) 2008-2009, Roland Lammel C<< <lammel@cpan.org> >>, http://www.quikit.at. Some rights reserved.
+Copyright (c) 2008-2010, Roland Lammel C<< <lammel@cpan.org> >>, http://www.quikit.at. Some rights reserved.
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>.
View
29 t/99bench.t
@@ -8,7 +8,7 @@ use Log::Log4perl;
use vars qw($tmplogfile);
use Test::More;
-plan skip_all => "Set TEST_MAINT=1 if benchmark should be run with the testsuite" unless $ENV{TEST_MAINT};
+plan skip_all => 'Author test. Set $ENV{TEST_AUTHOR} to run benchmark tests' unless $ENV{TEST_AUTHOR};
plan tests => 6;
BEGIN { $tmplogfile = 'mxll4p_benchtest.log'; }
@@ -17,7 +17,7 @@ END {
unlink($tmplogfile) if (-f $tmplogfile);
}
-{
+{
### Define a custom Log4perl appender that simply does not log anything
### as we only need to check on call performance not actuall performance
### of the appender
@@ -31,7 +31,7 @@ END {
use Moose;
with 'MooseX::Log::Log4perl';
-
+
sub testlog { shift->log->info("Just a test for logging"); }
sub testlogger { shift->logger->info("Just a test for logging"); }
__PACKAGE__->meta->make_immutable;
@@ -42,9 +42,9 @@ END {
use Log::Log4perl;
use vars qw($log);
-
+
BEGIN { $log = Log::Log4perl->get_logger(__PACKAGE__); }
-
+
sub new { bless({log=>$log},__PACKAGE__); }
sub log { return shift->{log}; };
@@ -63,22 +63,15 @@ log4perl.appender.Nirvana.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.Nirvana.layout.ConversionPattern = %p [%c] %m%n
__ENDCFG__
Log::Log4perl->init(\$cfg);
-
+
my $mxl = new BenchMooseXLogLog4perl();
my $llp = new BenchLogLog4perl();
-
+
isa_ok( $mxl, 'BenchMooseXLogLog4perl', 'Bench instance for MooseX::Log::Log4perl');
isa_ok( $llp, 'BenchLogLog4perl', 'Bench instance for Log::Log4perl');
- # my $bllp1 = Benchmark::timeit(100000, sub { $llp->testlog() });
- # diag(timestr($bllp1));
- # my $bllp2 = Benchmark::timeit(100000, sub { $llp->testlogobj() });
- # diag(timestr($bllp2));
- # my $bmxl1 = Benchmark::timeit(100000, sub { $mxl->testlog() });
- # diag(timestr($bmxl1));
- # my $bmxl2 = Benchmark::timeit(100000, sub { $mxl->testlogger() });
- # diag(timestr($bmxl2));
- ### We expect some bsaic performance of approx. 10% to Log4perl directly
+ ### We expect some basic performance of approx. 95% of Log4perl directly
+ diag("Running benchmarks, please wait a minute...");
my $result = cmpthese(-10, {
'Log4perl direct' => sub { $llp->testlogdirect() },
'Log4perl method' => sub { $llp->testlogmethod() },
@@ -102,10 +95,10 @@ __ENDCFG__
"(%i / %i = %.2f %%) to Log4perl direct", $bench{'MooseX-L4p logger'}, $bench{'Log4perl direct'}, $rate_log));
$rate_logger = 100 * $bench{'MooseX-L4p logger'} / $bench{'Log4perl method'};
- ok($rate_logger > 97, sprintf("Call rate of ->logger must be above 98%% " .
+ ok($rate_logger > 97, sprintf("Call rate of ->logger must be above 97%% " .
"(%i / %i = %.2f %%) to Log4perl via method", $bench{'MooseX-L4p logger'}, $bench{'Log4perl method'}, $rate_logger));
$rate_log = 100 * $bench{'MooseX-L4p log'} / $bench{'Log4perl method'};
- ok($rate_log > 96, sprintf("Call rate of ->log must be above 97%% " .
+ ok($rate_log > 96, sprintf("Call rate of ->log must be above 96%% " .
"(%i / %i = %.2f %%) to Log4perl via method", $bench{'MooseX-L4p logger'}, $bench{'Log4perl method'}, $rate_log));
}
View
21 t/perl-critic.t
@@ -0,0 +1,21 @@
+use strict;
+use warnings;
+use File::Spec;
+use Test::More;
+use English qw(-no_match_vars);
+
+if ( not($ENV{TEST_AUTHOR} || $ENV{TEST_CRITIC}) ) {
+ my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.';
+ plan( skip_all => $msg );
+}
+
+eval { require Test::Perl::Critic; };
+
+if ( $EVAL_ERROR ) {
+ my $msg = 'Test::Perl::Critic required to criticise code';
+ plan( skip_all => $msg );
+}
+
+my $rcfile = File::Spec->catfile( 't', 'perlcriticrc' );
+Test::Perl::Critic->import( -profile => $rcfile );
+all_critic_ok();
View
9 t/perlcriticrc
@@ -0,0 +1,9 @@
+severity = harsh
+# only = 1
+# force = 0
+verbose = 4
+# top = 50
+theme = core
+# include = NamingConventions ClassHierarchies #Space-delimited list
+exclude = Subroutines::RequireArgUnpacking Subroutines::RequireFinalReturn Subroutines::ProhibitBuiltinHomonyms Variables::RequireInitializationForLocalVars
+# criticism-fatal = 1 #Zero or One
View
9 t/pod.t
@@ -1,6 +1,9 @@
-#!perl
-
+use strict;
+use warnings;
use Test::More;
+
eval "use Test::Pod 1.14";
-plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+plan skip_all => 'Test::Pod 1.14 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
all_pod_files_ok();
View
9 t/podcoverage.t
@@ -0,0 +1,9 @@
+use strict;
+use warnings;
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_coverage_ok();
Please sign in to comment.
Something went wrong with that request. Please try again.