Hello community, here is the log from the commit of package perl-Log-Any for openSUSE:Factory checked in at 2016-09-26 12:36:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Log-Any (Old) and /work/SRC/openSUSE:Factory/.perl-Log-Any.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Log-Any" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Log-Any/perl-Log-Any.changes 2016-03-16 10:34:12.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Log-Any.new/perl-Log-Any.changes 2016-09-26 12:36:09.000000000 +0200 @@ -1,0 +2,38 @@ +Mon Aug 29 05:46:32 UTC 2016 - [email protected] + +- updated to 1.042 + see /usr/share/doc/packages/perl-Log-Any/Changes + +------------------------------------------------------------------- +Sun Aug 28 05:37:08 UTC 2016 - [email protected] + +- updated to 1.042 + see /usr/share/doc/packages/perl-Log-Any/Changes + + 1.042 2016-08-26 23:37:33-05:00 America/Chicago + + [Added] + + - Default adapters can now be configured with arguments (thanks + @bjakubski!) + + 1.041 2016-08-18 00:00:10-05:00 America/Chicago (TRIAL RELEASE) + + [Added] + + - Logging methods now return the formatted log string so that it can + be used in a `die` or `warn` call. + + [Changed] + + - A new default log proxy (Log::Any::Proxy::Null) is used when there + are no adapters configured (and so no place for logs to go). This + proxy does no processing and is about 1000% percent faster on my + laptop. + + [Fixed] + + - Suppress 'redundant argument' warnings if too many arguments are + given to a log formatting string. + +------------------------------------------------------------------- Old: ---- Log-Any-1.040.tar.gz New: ---- Log-Any-1.042.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Log-Any.spec ++++++ --- /var/tmp/diff_new_pack.e7LhsA/_old 2016-09-26 12:36:10.000000000 +0200 +++ /var/tmp/diff_new_pack.e7LhsA/_new 2016-09-26 12:36:10.000000000 +0200 @@ -17,14 +17,14 @@ Name: perl-Log-Any -Version: 1.040 +Version: 1.042 Release: 0 %define cpan_name Log-Any Summary: Bringing loggers and listeners together License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Log-Any/ -Source0: http://www.cpan.org/authors/id/D/DA/DAGOLDEN/%{cpan_name}-%{version}.tar.gz +Source0: http://www.cpan.org/authors/id/P/PR/PREACTION/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ Log-Any-1.040.tar.gz -> Log-Any-1.042.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/Changes new/Log-Any-1.042/Changes --- old/Log-Any-1.040/Changes 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/Changes 2016-08-27 06:37:41.000000000 +0200 @@ -2,6 +2,32 @@ ** denotes an incompatible change +1.042 2016-08-26 23:37:33-05:00 America/Chicago + + [Added] + + - Default adapters can now be configured with arguments (thanks + @bjakubski!) + +1.041 2016-08-18 00:00:10-05:00 America/Chicago (TRIAL RELEASE) + + [Added] + + - Logging methods now return the formatted log string so that it can + be used in a `die` or `warn` call. + + [Changed] + + - A new default log proxy (Log::Any::Proxy::Null) is used when there + are no adapters configured (and so no place for logs to go). This + proxy does no processing and is about 1000% percent faster on my + laptop. + + [Fixed] + + - Suppress 'redundant argument' warnings if too many arguments are + given to a log formatting string. + 1.040 2016-02-24 17:47:00-05:00 America/New_York [Fixed] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/LICENSE new/Log-Any-1.042/LICENSE --- old/Log-Any-1.040/LICENSE 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/LICENSE 2016-08-27 06:37:41.000000000 +0200 @@ -1,4 +1,4 @@ -This software is copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,7 +12,7 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is Copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software, licensed under: @@ -272,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is Copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software, licensed under: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/MANIFEST new/Log-Any-1.042/MANIFEST --- old/Log-Any-1.040/MANIFEST 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/MANIFEST 2016-08-27 06:37:41.000000000 +0200 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.043. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.007. CONTRIBUTING.mkdn Changes LICENSE @@ -21,11 +21,13 @@ lib/Log/Any/Adapter/Util.pm lib/Log/Any/Manager.pm lib/Log/Any/Proxy.pm +lib/Log/Any/Proxy/Null.pm lib/Log/Any/Proxy/Test.pm lib/Log/Any/Test.pm perlcritic.rc t/00-report-prereqs.dd t/00-report-prereqs.t +t/default-adapter-params.t t/default-adapter.t t/default-vs-test.t t/errors-adapter.t @@ -34,6 +36,7 @@ t/inner-adapter.t t/log-any-test.t t/memory.t +t/null-proxy.t t/proxy.t t/replace_log.t t/sprintf.t @@ -43,8 +46,8 @@ xt/author/critic.t xt/author/pod-spell.t xt/author/pod-syntax.t +xt/author/portability.t xt/author/test-version.t xt/release/backcompat.t xt/release/distmeta.t xt/release/minimum-version.t -xt/release/portability.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/META.json new/Log-Any-1.042/META.json --- old/Log-Any-1.040/META.json 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/META.json 2016-08-27 06:37:41.000000000 +0200 @@ -2,10 +2,11 @@ "abstract" : "Bringing loggers and listeners together", "author" : [ "Jonathan Swartz <[email protected]>", - "David Golden <[email protected]>" + "David Golden <[email protected]>", + "Doug Bell <[email protected]>" ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 5.043, CPAN::Meta::Converter version 2.150001", + "generated_by" : "Dist::Zilla version 6.007, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], @@ -48,6 +49,7 @@ "Test::CPAN::Meta" : "0", "Test::More" : "0", "Test::Pod" : "1.41", + "Test::Portability::Files" : "0", "Test::Spelling" : "0.12", "Test::Version" : "1", "blib" : "1.01" @@ -85,77 +87,82 @@ "provides" : { "Log::Any" : { "file" : "lib/Log/Any.pm", - "version" : "1.040" + "version" : "1.042" }, "Log::Any::Adapter" : { "file" : "lib/Log/Any/Adapter.pm", - "version" : "1.040" + "version" : "1.042" }, "Log::Any::Adapter::Base" : { "file" : "lib/Log/Any/Adapter/Base.pm", - "version" : "1.040" + "version" : "1.042" }, "Log::Any::Adapter::File" : { "file" : "lib/Log/Any/Adapter/File.pm", - "version" : "1.040" + "version" : "1.042" }, "Log::Any::Adapter::Null" : { "file" : "lib/Log/Any/Adapter/Null.pm", - "version" : "1.040" + "version" : "1.042" }, "Log::Any::Adapter::Stderr" : { "file" : "lib/Log/Any/Adapter/Stderr.pm", - "version" : "1.040" + "version" : "1.042" }, "Log::Any::Adapter::Stdout" : { "file" : "lib/Log/Any/Adapter/Stdout.pm", - "version" : "1.040" + "version" : "1.042" }, "Log::Any::Adapter::Test" : { "file" : "lib/Log/Any/Adapter/Test.pm", - "version" : "1.040" + "version" : "1.042" }, "Log::Any::Adapter::Util" : { "file" : "lib/Log/Any/Adapter/Util.pm", - "version" : "1.040" + "version" : "1.042" }, "Log::Any::Manager" : { "file" : "lib/Log/Any/Manager.pm", - "version" : "1.040" + "version" : "1.042" }, "Log::Any::Proxy" : { "file" : "lib/Log/Any/Proxy.pm", - "version" : "1.040" + "version" : "1.042" + }, + "Log::Any::Proxy::Null" : { + "file" : "lib/Log/Any/Proxy/Null.pm", + "version" : "1.042" }, "Log::Any::Proxy::Test" : { "file" : "lib/Log/Any/Proxy/Test.pm", - "version" : "1.040" + "version" : "1.042" }, "Log::Any::Test" : { "file" : "lib/Log/Any/Test.pm", - "version" : "1.040" + "version" : "1.042" } }, "release_status" : "stable", "resources" : { "bugtracker" : { - "web" : "https://github.com/dagolden/Log-Any/issues" + "web" : "https://github.com/preaction/Log-Any/issues" }, - "homepage" : "https://github.com/dagolden/Log-Any", + "homepage" : "https://github.com/preaction/Log-Any", "repository" : { "type" : "git", - "url" : "https://github.com/dagolden/Log-Any.git", - "web" : "https://github.com/dagolden/Log-Any" + "url" : "https://github.com/preaction/Log-Any.git", + "web" : "https://github.com/preaction/Log-Any" } }, - "version" : "1.040", - "x_authority" : "cpan:JSWARTZ", + "version" : "1.042", + "x_authority" : "cpan:PREACTION", "x_contributors" : [ + "bj5004 <[email protected]>", "cm-perl <[email protected]>", - "Doug Bell <[email protected]>", "Lucas Kanashiro <[email protected]>", "Maxim Vuets <[email protected]>", "Stephen Thirlwall <[email protected]>" - ] + ], + "x_serialization_backend" : "Cpanel::JSON::XS version 3.0216" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/META.yml new/Log-Any-1.042/META.yml --- old/Log-Any-1.040/META.yml 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/META.yml 2016-08-27 06:37:41.000000000 +0200 @@ -3,6 +3,7 @@ author: - 'Jonathan Swartz <[email protected]>' - 'David Golden <[email protected]>' + - 'Doug Bell <[email protected]>' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' @@ -14,7 +15,7 @@ ExtUtils::MakeMaker: '6.17' perl: '5.008001' dynamic_config: 0 -generated_by: 'Dist::Zilla version 5.043, CPAN::Meta::Converter version 2.150001' +generated_by: 'Dist::Zilla version 6.007, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -32,43 +33,46 @@ provides: Log::Any: file: lib/Log/Any.pm - version: '1.040' + version: '1.042' Log::Any::Adapter: file: lib/Log/Any/Adapter.pm - version: '1.040' + version: '1.042' Log::Any::Adapter::Base: file: lib/Log/Any/Adapter/Base.pm - version: '1.040' + version: '1.042' Log::Any::Adapter::File: file: lib/Log/Any/Adapter/File.pm - version: '1.040' + version: '1.042' Log::Any::Adapter::Null: file: lib/Log/Any/Adapter/Null.pm - version: '1.040' + version: '1.042' Log::Any::Adapter::Stderr: file: lib/Log/Any/Adapter/Stderr.pm - version: '1.040' + version: '1.042' Log::Any::Adapter::Stdout: file: lib/Log/Any/Adapter/Stdout.pm - version: '1.040' + version: '1.042' Log::Any::Adapter::Test: file: lib/Log/Any/Adapter/Test.pm - version: '1.040' + version: '1.042' Log::Any::Adapter::Util: file: lib/Log/Any/Adapter/Util.pm - version: '1.040' + version: '1.042' Log::Any::Manager: file: lib/Log/Any/Manager.pm - version: '1.040' + version: '1.042' Log::Any::Proxy: file: lib/Log/Any/Proxy.pm - version: '1.040' + version: '1.042' + Log::Any::Proxy::Null: + file: lib/Log/Any/Proxy/Null.pm + version: '1.042' Log::Any::Proxy::Test: file: lib/Log/Any/Proxy/Test.pm - version: '1.040' + version: '1.042' Log::Any::Test: file: lib/Log/Any/Test.pm - version: '1.040' + version: '1.042' requires: B: '0' Carp: '0' @@ -82,14 +86,15 @@ strict: '0' warnings: '0' resources: - bugtracker: https://github.com/dagolden/Log-Any/issues - homepage: https://github.com/dagolden/Log-Any - repository: https://github.com/dagolden/Log-Any.git -version: '1.040' -x_authority: cpan:JSWARTZ + bugtracker: https://github.com/preaction/Log-Any/issues + homepage: https://github.com/preaction/Log-Any + repository: https://github.com/preaction/Log-Any.git +version: '1.042' +x_authority: cpan:PREACTION x_contributors: + - 'bj5004 <[email protected]>' - 'cm-perl <[email protected]>' - - 'Doug Bell <[email protected]>' - 'Lucas Kanashiro <[email protected]>' - 'Maxim Vuets <[email protected]>' - 'Stephen Thirlwall <[email protected]>' +x_serialization_backend: 'YAML::Tiny version 1.69' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/Makefile.PL new/Log-Any-1.042/Makefile.PL --- old/Log-Any-1.040/Makefile.PL 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/Makefile.PL 2016-08-27 06:37:41.000000000 +0200 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.043. +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.007. use strict; use warnings; @@ -8,7 +8,7 @@ my %WriteMakefileArgs = ( "ABSTRACT" => "Bringing loggers and listeners together", - "AUTHOR" => "Jonathan Swartz <swartz\@pobox.com>, David Golden <dagolden\@cpan.org>", + "AUTHOR" => "Jonathan Swartz <swartz\@pobox.com>, David Golden <dagolden\@cpan.org>, Doug Bell <preaction\@cpan.org>", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.17" }, @@ -35,7 +35,7 @@ "Test::More" => 0, "base" => 0 }, - "VERSION" => "1.040", + "VERSION" => "1.042", "test" => { "TESTS" => "t/*.t" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/README new/Log-Any-1.042/README --- old/Log-Any-1.040/README 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/README 2016-08-27 06:37:41.000000000 +0200 @@ -2,7 +2,7 @@ Log::Any - Bringing loggers and listeners together VERSION - version 1.040 + version 1.042 SYNOPSIS In a CPAN or other module: @@ -16,6 +16,9 @@ # log a string and data using a formatting filter $log->debugf("arguments are: %s", \@_); + # log an error and throw an exception + die $log->fatal("a fatal error occurred"); + In a Moo/Moose-based module: package Foo; @@ -144,6 +147,9 @@ $log->warn("this is a warning"); $log->warning("this is also a warning"); + The log string will be returned so that it can be used further (e.g. for + a "die" or "warn" call). + You should not include a newline in your message; that is the responsibility of the logging mechanism, which may or may not want the newline. @@ -187,14 +193,23 @@ all detection methods. Setting an alternate default logger - To choose something other than Null as the default, pass it as a - parameter when loading "Log::Any" + When no other adapters are configured for your logger, "Log::Any" uses + the "default_adapter". To choose something other than Null as the + default, pass it as a parameter when loading "Log::Any" use Log::Any '$log', default_adapter => 'Stderr'; The name of the default class follows the same rules as used by Log::Any::Adapter. + To pass arguments to the default adapter's constructor, use an arrayref: + + use Log::Any '$log', default_adapter => [ 'File' => '/var/log/mylog.log' ]; + + When a consumer configures their own adapter, the default adapter will + be overridden. If they later remove their adapter, the default adapter + will be used again. + Configuring the proxy Any parameter passed on the import line or via the "get_logger" method are passed on the the Log::Any::Proxy constructor. @@ -249,26 +264,28 @@ SUPPORT Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker at - <https://github.com/dagolden/Log-Any/issues>. You will be notified + <https://github.com/preaction/Log-Any/issues>. You will be notified automatically of any progress on your issue. Source Code This is open source software. The code repository is available for public review and contribution under the terms of the license. - <https://github.com/dagolden/Log-Any> + <https://github.com/preaction/Log-Any> - git clone https://github.com/dagolden/Log-Any.git + git clone https://github.com/preaction/Log-Any.git AUTHORS * Jonathan Swartz <[email protected]> * David Golden <[email protected]> + * Doug Bell <[email protected]> + CONTRIBUTORS - * cm-perl <[email protected]> + * bj5004 <[email protected]> - * Doug Bell <[email protected]> + * cm-perl <[email protected]> * Lucas Kanashiro <[email protected]> @@ -277,7 +294,8 @@ * Stephen Thirlwall <[email protected]> COPYRIGHT AND LICENSE - This software is copyright (c) 2014 by Jonathan Swartz and David Golden. + This software is copyright (c) 2016 by Jonathan Swartz, David Golden, + and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/cpanfile new/Log-Any-1.042/cpanfile --- old/Log-Any-1.040/cpanfile 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/cpanfile 2016-08-27 06:37:41.000000000 +0200 @@ -42,6 +42,7 @@ requires "Test::CPAN::Meta" => "0"; requires "Test::More" => "0"; requires "Test::Pod" => "1.41"; + requires "Test::Portability::Files" => "0"; requires "Test::Spelling" => "0.12"; requires "Test::Version" => "1"; requires "blib" => "1.01"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/dist.ini new/Log-Any-1.042/dist.ini --- old/Log-Any-1.040/dist.ini 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/dist.ini 2016-08-27 06:37:41.000000000 +0200 @@ -2,14 +2,15 @@ abstract = Bringing loggers and listeners together author = Jonathan Swartz <[email protected]> author = David Golden <[email protected]> +author = Doug Bell <[email protected]> license = Perl_5 -copyright_year = 2014 -copyright_holder = Jonathan Swartz and David Golden +copyright_year = 2016 +copyright_holder = Jonathan Swartz, David Golden, and Doug Bell [@DAGOLDEN] :version = 0.072 MetaNoIndex.package[0] = Log::Any::Manager::_Guard -authority = cpan:JSWARTZ +authority = cpan:PREACTION no_coverage = 1 stopwords = alertf stopwords = crit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Adapter/Base.pm new/Log-Any-1.042/lib/Log/Any/Adapter/Base.pm --- old/Log-Any-1.040/lib/Log/Any/Adapter/Base.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Adapter/Base.pm 2016-08-27 06:37:41.000000000 +0200 @@ -4,7 +4,7 @@ package Log::Any::Adapter::Base; -our $VERSION = '1.040'; +our $VERSION = '1.042'; # we import these in case any legacy adapter uses them as class methods use Log::Any::Adapter::Util qw/make_method dump_one_line/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Adapter/Development.pod new/Log-Any-1.042/lib/Log/Any/Adapter/Development.pod --- old/Log-Any-1.040/lib/Log/Any/Adapter/Development.pod 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Adapter/Development.pod 2016-08-27 06:37:41.000000000 +0200 @@ -16,7 +16,7 @@ =head1 VERSION -version 1.040 +version 1.042 =head1 SYNOPSIS @@ -357,11 +357,15 @@ David Golden <[email protected]> +=item * + +Doug Bell <[email protected]> + =back =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Adapter/File.pm new/Log-Any-1.042/lib/Log/Any/Adapter/File.pm --- old/Log-Any-1.040/lib/Log/Any/Adapter/File.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Adapter/File.pm 2016-08-27 06:37:41.000000000 +0200 @@ -5,7 +5,7 @@ package Log::Any::Adapter::File; # ABSTRACT: Simple adapter for logging to files -our $VERSION = '1.040'; +our $VERSION = '1.042'; use Config; use Fcntl qw/:flock/; @@ -76,7 +76,7 @@ =head1 VERSION -version 1.040 +version 1.042 =head1 SYNOPSIS @@ -124,11 +124,15 @@ David Golden <[email protected]> +=item * + +Doug Bell <[email protected]> + =back =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Adapter/Null.pm new/Log-Any-1.042/lib/Log/Any/Adapter/Null.pm --- old/Log-Any-1.040/lib/Log/Any/Adapter/Null.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Adapter/Null.pm 2016-08-27 06:37:41.000000000 +0200 @@ -5,7 +5,7 @@ package Log::Any::Adapter::Null; # ABSTRACT: Discards all log messages -our $VERSION = '1.040'; +our $VERSION = '1.042'; use Log::Any::Adapter::Base; our @ISA = qw/Log::Any::Adapter::Base/; @@ -33,7 +33,7 @@ =head1 VERSION -version 1.040 +version 1.042 =head1 SYNOPSIS @@ -61,11 +61,15 @@ David Golden <[email protected]> +=item * + +Doug Bell <[email protected]> + =back =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Adapter/Stderr.pm new/Log-Any-1.042/lib/Log/Any/Adapter/Stderr.pm --- old/Log-Any-1.040/lib/Log/Any/Adapter/Stderr.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Adapter/Stderr.pm 2016-08-27 06:37:41.000000000 +0200 @@ -5,7 +5,7 @@ package Log::Any::Adapter::Stderr; # ABSTRACT: Simple adapter for logging to STDERR -our $VERSION = '1.040'; +our $VERSION = '1.042'; use Log::Any::Adapter::Util (); @@ -59,7 +59,7 @@ =head1 VERSION -version 1.040 +version 1.042 =head1 SYNOPSIS @@ -98,11 +98,15 @@ David Golden <[email protected]> +=item * + +Doug Bell <[email protected]> + =back =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Adapter/Stdout.pm new/Log-Any-1.042/lib/Log/Any/Adapter/Stdout.pm --- old/Log-Any-1.040/lib/Log/Any/Adapter/Stdout.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Adapter/Stdout.pm 2016-08-27 06:37:41.000000000 +0200 @@ -5,7 +5,7 @@ package Log::Any::Adapter::Stdout; # ABSTRACT: Simple adapter for logging to STDOUT -our $VERSION = '1.040'; +our $VERSION = '1.042'; use Log::Any::Adapter::Util (); @@ -59,7 +59,7 @@ =head1 VERSION -version 1.040 +version 1.042 =head1 SYNOPSIS @@ -98,11 +98,15 @@ David Golden <[email protected]> +=item * + +Doug Bell <[email protected]> + =back =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Adapter/Test.pm new/Log-Any-1.042/lib/Log/Any/Adapter/Test.pm --- old/Log-Any-1.040/lib/Log/Any/Adapter/Test.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Adapter/Test.pm 2016-08-27 06:37:41.000000000 +0200 @@ -4,7 +4,7 @@ package Log::Any::Adapter::Test; -our $VERSION = '1.040'; +our $VERSION = '1.042'; use Log::Any::Adapter::Util qw/dump_one_line/; use Test::Builder; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Adapter/Util.pm new/Log-Any-1.042/lib/Log/Any/Adapter/Util.pm --- old/Log-Any-1.040/lib/Log/Any/Adapter/Util.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Adapter/Util.pm 2016-08-27 06:37:41.000000000 +0200 @@ -5,7 +5,7 @@ package Log::Any::Adapter::Util; # ABSTRACT: Common utility functions for Log::Any -our $VERSION = '1.040'; +our $VERSION = '1.042'; use Exporter; our @ISA = qw/Exporter/; @@ -241,7 +241,7 @@ =head1 VERSION -version 1.040 +version 1.042 =head1 DESCRIPTION @@ -339,11 +339,15 @@ David Golden <[email protected]> +=item * + +Doug Bell <[email protected]> + =back =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Adapter.pm new/Log-Any-1.042/lib/Log/Any/Adapter.pm --- old/Log-Any-1.040/lib/Log/Any/Adapter.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Adapter.pm 2016-08-27 06:37:41.000000000 +0200 @@ -5,7 +5,7 @@ package Log::Any::Adapter; # ABSTRACT: Tell Log::Any where to send its logs -our $VERSION = '1.040'; +our $VERSION = '1.042'; use Log::Any; @@ -38,7 +38,7 @@ =head1 VERSION -version 1.040 +version 1.042 =head1 SYNOPSIS @@ -243,11 +243,15 @@ David Golden <[email protected]> +=item * + +Doug Bell <[email protected]> + =back =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Manager.pm new/Log-Any-1.042/lib/Log/Any/Manager.pm --- old/Log-Any-1.040/lib/Log/Any/Manager.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Manager.pm 2016-08-27 06:37:41.000000000 +0200 @@ -4,13 +4,17 @@ package Log::Any::Manager; -our $VERSION = '1.040'; +our $VERSION = '1.042'; sub new { my $class = shift; my $self = { + # The stack of adapter entries entries => [], + # A cache of keys with category names and values of a hashref + # with stack entries (from the entries attribute) and adapters category_cache => {}, + # The adapter to use if no other adapter is appropriate default_adapter => {}, }; bless $self, $class; @@ -18,6 +22,11 @@ return $self; } +sub has_consumer { + my ( $self ) = @_; + return !!( @{ $self->{entries} } || keys %{ $self->{default_adapter} } ); +} + sub get_adapter { my ( $self, $category ) = @_; @@ -65,10 +74,24 @@ sub set_default { my ( $self, $category, $adapter_name, @adapter_params ) = @_; + Log::Any::Proxy::Null->inflate_nulls; my $adapter_class = $self->_get_adapter_class($adapter_name); $self->{default_adapter}{$category} = [$adapter_class, \@adapter_params]; } +# =head2 set +# +# $mgr->set( $options ); +# +# Set the current adapter. Called from +# L<Log::Any::Adapter::set|Log::Any::Adapter/SETTING AND REMOVING ADAPTERS>, the +# standard API for setting the current adapter. Adds a new entry to the +# C<entries> stack and refreshes all the matching adapters. +# +# See L<Log::Any::Adapter|Log::Any::Adapter/SETTING AND REMOVING ADAPTERS> +# for available options. +# +# Returns the newly-created entry in the stack. sub set { my $self = shift; my $options; @@ -103,6 +126,7 @@ sub { $self->remove($entry) unless _in_global_destruction() } ); } + Log::Any::Proxy::Null->inflate_nulls; return $entry; } @@ -124,6 +148,14 @@ }; } +# =head2 _reselect_matching_adapters +# +# $self->_reselect_matching_adapters( $pattern ) +# +# Given a pattern, reselect which adapter should match. This is called +# after entries are added/removed from the C<entries> attribute. +# +# XXX Does not actually use $pattern, so do we need to pass it in? sub _reselect_matching_adapters { my ( $self, $pattern ) = @_; @@ -138,6 +170,8 @@ if ( $new_entry ne $category_info->{entry} ) { my $new_adapter = $self->_new_adapter_for_entry( $new_entry, $category ); + # Replace existing references to the adapter with the new + # adapter %{ $category_info->{adapter} } = %$new_adapter; bless( $category_info->{adapter}, ref($new_adapter) ); $category_info->{entry} = $new_entry; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Proxy/Null.pm new/Log-Any-1.042/lib/Log/Any/Proxy/Null.pm --- old/Log-Any-1.040/lib/Log/Any/Proxy/Null.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Proxy/Null.pm 2016-08-27 06:37:41.000000000 +0200 @@ -0,0 +1,87 @@ +use 5.008001; +use strict; +use warnings; + +package Log::Any::Proxy::Null; + +# ABSTRACT: Log::Any generator proxy for no adapters +our $VERSION = '1.042'; + +use Log::Any::Adapter::Util (); +use Log::Any::Proxy; +our @ISA = qw/Log::Any::Proxy/; + +# Null proxy objects waiting for inflation into regular proxy objects +my @nulls; + +sub new { + my $obj = shift->SUPER::new( @_ ); + push @nulls, $obj; + return $obj; +} + +sub inflate_nulls { + bless shift( @nulls ), 'Log::Any::Proxy' while @nulls; +} + +my %aliases = Log::Any::Adapter::Util::log_level_aliases(); + +# Set up methods/aliases and detection methods/aliases +foreach my $name ( Log::Any::Adapter::Util::logging_methods(), keys(%aliases) ) +{ + my $namef = $name . "f"; + my $super_name = "SUPER::" . $name; + my $super_namef = "SUPER::" . $namef; + no strict 'refs'; + *{$name} = sub { + return unless defined wantarray; + return shift->$super_name( @_ ); + }; + *{$namef} = sub { + return unless defined wantarray; + return shift->$super_namef( @_ ); + }; +} + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +Log::Any::Proxy::Null - Log::Any generator proxy for no adapters + +=head1 VERSION + +version 1.042 + +=head1 AUTHORS + +=over 4 + +=item * + +Jonathan Swartz <[email protected]> + +=item * + +David Golden <[email protected]> + +=item * + +Doug Bell <[email protected]> + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Proxy/Test.pm new/Log-Any-1.042/lib/Log/Any/Proxy/Test.pm --- old/Log-Any-1.040/lib/Log/Any/Proxy/Test.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Proxy/Test.pm 2016-08-27 06:37:41.000000000 +0200 @@ -4,7 +4,7 @@ package Log::Any::Proxy::Test; -our $VERSION = '1.040'; +our $VERSION = '1.042'; use Log::Any::Proxy; our @ISA = qw/Log::Any::Proxy/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Proxy.pm new/Log-Any-1.042/lib/Log/Any/Proxy.pm --- old/Log-Any-1.040/lib/Log/Any/Proxy.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Proxy.pm 2016-08-27 06:37:41.000000000 +0200 @@ -5,7 +5,7 @@ package Log::Any::Proxy; # ABSTRACT: Log::Any generator proxy object -our $VERSION = '1.040'; +our $VERSION = '1.042'; use Log::Any::Adapter::Util (); @@ -18,6 +18,12 @@ : ref($_) ? Log::Any::Adapter::Util::dump_one_line($_) : $_ } @params; + # Perl 5.22 adds a 'redundant' warning if the number parameters exceeds + # the number of sprintf placeholders. If a user does this, the warning + # is issued from here, which isn't very helpful. Doing something + # clever would be expensive, so instead we just disable warnings for + # the final line of this subroutine. + no warnings; return sprintf( $format, @new_params ); } @@ -62,13 +68,16 @@ *{$name} = sub { my ( $self, @parts ) = @_; my $message = join(" ", grep { defined($_) && length($_) } @parts ); - return unless length $message; - $message = $self->{filter}->( $self->{category}, $numeric, $message ) - if defined $self->{filter}; - return unless defined $message and length $message; - $message = "$self->{prefix}$message" - if defined $self->{prefix} && length $self->{prefix}; - return $self->{adapter}->$realname($message); + if ( length $message ) { + $message = $self->{filter}->( $self->{category}, $numeric, $message ) + if defined $self->{filter}; + if ( defined $message and length $message ) { + $message = "$self->{prefix}$message" + if defined $self->{prefix} && length $self->{prefix}; + $self->{adapter}->$realname($message); + } + } + return $message if defined wantarray; }; *{$namef} = sub { my ( $self, @args ) = @_; @@ -97,7 +106,7 @@ =head1 VERSION -version 1.040 +version 1.042 =head1 SYNOPSIS @@ -171,7 +180,7 @@ $log->info("Got some new for you."); The log string will be transformed via the C<filter> attribute (if any) and -the C<prefix> (if any) will be prepended. +the C<prefix> (if any) will be prepended. Returns the transformed log string. B<NOTE>: While you are encouraged to pass a single string to be logged, if multiple arguments are passed, they are concatenated with a space character @@ -237,7 +246,8 @@ formatting. Finally, the message string is logged via the simple logging functions, -which can transform or prefix as described above. +which can transform or prefix as described above. The transformed log +string is then returned. =head1 ATTRIBUTES @@ -317,11 +327,15 @@ David Golden <[email protected]> +=item * + +Doug Bell <[email protected]> + =back =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any/Test.pm new/Log-Any-1.042/lib/Log/Any/Test.pm --- old/Log-Any-1.040/lib/Log/Any/Test.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any/Test.pm 2016-08-27 06:37:41.000000000 +0200 @@ -5,7 +5,7 @@ package Log::Any::Test; # ABSTRACT: Test what you're logging with Log::Any -our $VERSION = '1.040'; +our $VERSION = '1.042'; no warnings 'once'; $Log::Any::OverrideDefaultAdapterClass = 'Log::Any::Adapter::Test'; @@ -25,7 +25,7 @@ =head1 VERSION -version 1.040 +version 1.042 =head1 SYNOPSIS @@ -54,8 +54,12 @@ logged with Log::Any. Most of its API and implementation have been taken from L<Log::Any::Dispatch|Log::Any::Dispatch>. -Using C<Log::Any::Test> sends all subsequent Log::Any log messages to a single -global in-memory buffer. It should be used before L<Log::Any|Log::Any>. +Using C<Log::Any::Test> signals C<Log::Any> to send all subsequent log +messages to a single global in-memory buffer and to make the log proxy +provide a number of testing functions. To use it, load C<Log::Any::Test> +before anything that loads C<Log::Any>. To actually use the test methods, +you need to load C<Log::Any> and get a log object from it, as shown in the +L</SYNOPSIS>. =head1 METHODS @@ -134,11 +138,15 @@ David Golden <[email protected]> +=item * + +Doug Bell <[email protected]> + =back =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/lib/Log/Any.pm new/Log-Any-1.042/lib/Log/Any.pm --- old/Log-Any-1.040/lib/Log/Any.pm 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/lib/Log/Any.pm 2016-08-27 06:37:41.000000000 +0200 @@ -5,9 +5,10 @@ package Log::Any; # ABSTRACT: Bringing loggers and listeners together -our $VERSION = '1.040'; +our $VERSION = '1.042'; use Log::Any::Manager; +use Log::Any::Proxy::Null; use Log::Any::Adapter::Util qw( require_dynamic detection_aliases @@ -76,7 +77,18 @@ defined $params{category} ? delete $params{'category'} : caller; if ( my $default = delete $params{'default_adapter'} ) { - $class->_manager->set_default( $category, $default ); + my @default_adapter_params = (); + if (ref $default eq 'ARRAY') { + ($default, @default_adapter_params) = @{ $default }; + } + # Every default adapter is set only for a given logger category. + # When another adapter is configured (by using + # Log::Any::Adapter->set) for this category, it takes + # precedence, but if that adapter is later removed, the default + # we set here takes over again. + $class->_manager->set_default( + $category, $default, @default_adapter_params + ); } my $adapter = $class->_manager->get_adapter( $category ); @@ -91,7 +103,8 @@ my ( $self, $proxy_name ) = @_; return $Log::Any::OverrideDefaultProxyClass if $Log::Any::OverrideDefaultProxyClass; - return "Log::Any::Proxy" unless $proxy_name; + return "Log::Any::Proxy" if !$proxy_name && _manager->has_consumer; + return "Log::Any::Proxy::Null" if !$proxy_name; my $proxy_class = ( substr( $proxy_name, 0, 1 ) eq '+' ? substr( $proxy_name, 1 ) @@ -120,7 +133,7 @@ =head1 VERSION -version 1.040 +version 1.042 =head1 SYNOPSIS @@ -135,6 +148,9 @@ # log a string and data using a formatting filter $log->debugf("arguments are: %s", \@_); + # log an error and throw an exception + die $log->fatal("a fatal error occurred"); + In a Moo/Moose-based module: package Foo; @@ -266,6 +282,9 @@ $log->warn("this is a warning"); $log->warning("this is also a warning"); +The log string will be returned so that it can be used further (e.g. for a C<die> or +C<warn> call). + You should B<not> include a newline in your message; that is the responsibility of the logging mechanism, which may or may not want the newline. @@ -315,13 +334,22 @@ =head2 Setting an alternate default logger -To choose something other than Null as the default, pass it as a parameter when -loading C<Log::Any> +When no other adapters are configured for your logger, C<Log::Any> uses +the C<default_adapter>. To choose something other than Null as the +default, pass it as a parameter when loading C<Log::Any> use Log::Any '$log', default_adapter => 'Stderr'; The name of the default class follows the same rules as used by L<Log::Any::Adapter>. +To pass arguments to the default adapter's constructor, use an arrayref: + + use Log::Any '$log', default_adapter => [ 'File' => '/var/log/mylog.log' ]; + +When a consumer configures their own adapter, the default adapter will be +overridden. If they later remove their adapter, the default adapter will be +used again. + =head2 Configuring the proxy Any parameter passed on the import line or via the C<get_logger> method @@ -389,7 +417,7 @@ =head2 Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker -at L<https://github.com/dagolden/Log-Any/issues>. +at L<https://github.com/preaction/Log-Any/issues>. You will be notified automatically of any progress on your issue. =head2 Source Code @@ -397,9 +425,9 @@ This is open source software. The code repository is available for public review and contribution under the terms of the license. -L<https://github.com/dagolden/Log-Any> +L<https://github.com/preaction/Log-Any> - git clone https://github.com/dagolden/Log-Any.git + git clone https://github.com/preaction/Log-Any.git =head1 AUTHORS @@ -413,21 +441,25 @@ David Golden <[email protected]> +=item * + +Doug Bell <[email protected]> + =back =head1 CONTRIBUTORS -=for stopwords cm-perl Doug Bell Lucas Kanashiro Maxim Vuets Stephen Thirlwall +=for stopwords bj5004 cm-perl Lucas Kanashiro Maxim Vuets Stephen Thirlwall =over 4 =item * -cm-perl <[email protected]> +bj5004 <[email protected]> =item * -Doug Bell <[email protected]> +cm-perl <[email protected]> =item * @@ -445,7 +477,7 @@ =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2014 by Jonathan Swartz and David Golden. +This software is copyright (c) 2016 by Jonathan Swartz, David Golden, and Doug Bell. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/t/00-report-prereqs.dd new/Log-Any-1.042/t/00-report-prereqs.dd --- old/Log-Any-1.040/t/00-report-prereqs.dd 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/t/00-report-prereqs.dd 2016-08-27 06:37:41.000000000 +0200 @@ -20,6 +20,7 @@ 'Test::CPAN::Meta' => '0', 'Test::More' => '0', 'Test::Pod' => '1.41', + 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', 'Test::Version' => '1', 'blib' => '1.01' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/t/00-report-prereqs.t new/Log-Any-1.042/t/00-report-prereqs.t --- old/Log-Any-1.040/t/00-report-prereqs.t 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/t/00-report-prereqs.t 2016-08-27 06:37:41.000000000 +0200 @@ -3,7 +3,7 @@ use strict; use warnings; -# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.021 +# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.025 use Test::More tests => 1; @@ -78,10 +78,10 @@ # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; -if ( $source && $HAS_CPAN_META ) { - if ( my $meta = eval { CPAN::Meta->load_file($source) } ) { - $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); - } +if ( $source && $HAS_CPAN_META + && (my $meta = eval { CPAN::Meta->load_file($source) } ) +) { + $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $source = 'static metadata'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/t/default-adapter-params.t new/Log-Any-1.042/t/default-adapter-params.t --- old/Log-Any-1.040/t/default-adapter-params.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Log-Any-1.042/t/default-adapter-params.t 2016-08-27 06:37:41.000000000 +0200 @@ -0,0 +1,19 @@ +use strict; +use warnings; +use Test::More tests => 1; +use Log::Any; + +{ + my $buf = ''; + open my $fh, ">", \$buf; + local *STDERR = $fh; + + my $log = Log::Any->get_logger( + default_adapter => ['Stderr', log_level => 'error'] + ); + # check if log_level spewas applied + ok( + ( ! $log->is_warn and $log->is_error), + "log_level specified in default_adapter was applied" + ); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/t/null-proxy.t new/Log-Any-1.042/t/null-proxy.t --- old/Log-Any-1.040/t/null-proxy.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Log-Any-1.042/t/null-proxy.t 2016-08-27 06:37:41.000000000 +0200 @@ -0,0 +1,36 @@ + +use strict; +use warnings; +use Test::More; +use Log::Any; + +plan tests => 8; + +my $log = Log::Any->get_logger; +isa_ok $log, 'Log::Any::Proxy::Null', 'no adapter proxy is Null'; + +my $log_complex = Log::Any->get_logger( + category => 'Category:', + prefix => 'Prefix: ', + formatter => sub { "Formatter: @_" }, + filter => sub { "Filter: @_" }, +); +isa_ok $log_complex, 'Log::Any::Proxy::Null', 'no adapter proxy is Null'; + +my $log_explicit = Log::Any->get_logger( proxy_class => 'Test' ); +isa_ok $log_explicit, 'Log::Any::Proxy::Test', 'explicit proxy class is correct'; + +Log::Any->set_adapter( 'Test' ); + +isa_ok $log, 'Log::Any::Proxy', 'existing logger reblessed'; +isa_ok $log_complex, 'Log::Any::Proxy', 'existing logger reblessed'; +isa_ok $log_explicit, 'Log::Any::Proxy::Test', 'explicit proxy class is not reblessed'; + +$log->info("test"); +is Log::Any::Adapter::Test->msgs->[-1]{message}, 'test', 'log is logged'; + +$log_complex->infof('test'); +is Log::Any::Adapter::Test->msgs->[-1]{message}, + 'Prefix: Filter: Category: 6 Formatter: Category: 6 test', + 'proxy attributes are preserved'; + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/t/proxy.t new/Log-Any-1.042/t/proxy.t --- old/Log-Any-1.040/t/proxy.t 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/t/proxy.t 2016-08-27 06:37:41.000000000 +0200 @@ -4,41 +4,59 @@ use Log::Any::Test; use Log::Any::Adapter 'Test'; -plan tests => 7; +plan tests => 16; -my $log; +my ( $log, $out ); $log = Log::Any->get_logger( prefix => 'Foo: ' ); -$log->info("test"); +$out = $log->info("test"); $log->contains_ok(qr/^Foo: test$/, 'prefix added'); +is $out, 'Foo: test', 'log message built is returned'; $log->clear; $log = Log::Any->get_logger; -$log->info(qw/one two three four/); +$out = $log->info(qw/one two three four/); $log->contains_ok(qr/^one two three four$/, 'arguments concatenated'); +is $out, 'one two three four', 'log message built is returned'; $log->clear; $log = Log::Any->get_logger; -$log->infof(sub { "ran sub" } ); +$out = $log->infof(sub { "ran sub" } ); $log->contains_ok(qr/^ran sub$/, 'default formatter expands coderefs'); +is $out, 'ran sub', 'log message built is returned'; $log->clear; $log = Log::Any->get_logger; -$log->infof("got %s %s", "coderef", sub { "expanded" } ); +$out = $log->infof("got %s %s", "coderef", sub { "expanded" } ); $log->contains_ok(qr/DUMMY/, 'default formatter does not expand coderefs as sprintf args'); +like $out, qr/DUMMY/, 'log message built is returned'; $log->clear; +{ + # check that redundant parameters don't issue warnings (only on 5.22+) + my $w = ''; + local $SIG{__WARN__} = sub { $w = shift }; + $log = Log::Any->get_logger; + $log->infof("got %s", qw/Einstein Feynman/ ); + $log->contains_ok(qr/Einstein/); + is( $w, '', 'no warning' ); + $log->clear; +} + $log = Log::Any->get_logger( filter => sub { "@_"} ); -$log->emergency("test"); +$out = $log->emergency("test"); $log->contains_ok(qr/^main 0 test$/, 'filter has category and numeric level'); +is $out, 'main 0 test', 'log message run through filter is returned'; $log->clear; $log = Log::Any->get_logger( formatter => sub { "@_"} ); -$log->tracef("test foo"); +$out = $log->tracef("test foo"); $log->contains_ok(qr/^main 8 test foo$/, 'formatter has category and numeric level'); +is $out, 'main 8 test foo', 'log message run through formatter is returned'; $log->clear; $log = Log::Any->get_logger( category => 'Foo', filter => sub { "@_"} ); -$log->info("test"); +$out = $log->info("test"); $log->contains_ok(qr/^Foo 6 test$/, 'category override'); +is $out, 'Foo 6 test', 'log message with category and run through filter is returned'; $log->clear; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/xt/author/00-compile.t new/Log-Any-1.042/xt/author/00-compile.t --- old/Log-Any-1.040/xt/author/00-compile.t 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/xt/author/00-compile.t 2016-08-27 06:37:41.000000000 +0200 @@ -6,7 +6,7 @@ use Test::More; -plan tests => 14; +plan tests => 15; my @module_files = ( 'Log/Any.pm', @@ -20,6 +20,7 @@ 'Log/Any/Adapter/Util.pm', 'Log/Any/Manager.pm', 'Log/Any/Proxy.pm', + 'Log/Any/Proxy/Null.pm', 'Log/Any/Proxy/Test.pm', 'Log/Any/Test.pm' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/xt/author/pod-spell.t new/Log-Any-1.042/xt/author/pod-spell.t --- old/Log-Any-1.040/xt/author/pod-spell.t 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/xt/author/pod-spell.t 2016-08-27 06:37:41.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; use Test::More; -# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007000 +# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007002 use Test::Spelling 0.12; use Pod::Wordlist; @@ -34,11 +34,13 @@ David Golden dagolden -and -cm Doug Bell -madcityzen +preaction +and +bj5004 +bartosz +cm Lucas Kanashiro kanashiro diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/xt/author/portability.t new/Log-Any-1.042/xt/author/portability.t --- old/Log-Any-1.040/xt/author/portability.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Log-Any-1.042/xt/author/portability.t 2016-08-27 06:37:41.000000000 +0200 @@ -0,0 +1,10 @@ +use strict; +use warnings; + +use Test::More; + +eval 'use Test::Portability::Files'; +plan skip_all => 'Test::Portability::Files required for testing portability' + if $@; +options(test_one_dot => 0); +run_tests(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/xt/author/test-version.t new/Log-Any-1.042/xt/author/test-version.t --- old/Log-Any-1.040/xt/author/test-version.t 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/xt/author/test-version.t 2016-08-27 06:37:41.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; use Test::More; -# generated by Dist::Zilla::Plugin::Test::Version 1.05 +# generated by Dist::Zilla::Plugin::Test::Version 1.09 use Test::Version; my @imports = qw( version_all_ok ); @@ -17,7 +17,6 @@ push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); - Test::Version->import(@imports); version_all_ok; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Log-Any-1.040/xt/release/portability.t new/Log-Any-1.042/xt/release/portability.t --- old/Log-Any-1.040/xt/release/portability.t 2016-02-24 23:47:06.000000000 +0100 +++ new/Log-Any-1.042/xt/release/portability.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -#!perl - -use strict; -use warnings; - -use Test::More; - -eval 'use Test::Portability::Files'; -plan skip_all => 'Test::Portability::Files required for testing portability' - if $@; -options(test_one_dot => 0); -run_tests();
