Hello community,
here is the log from the commit of package perl-Log-Contextual for
openSUSE:Factory checked in at 2015-04-15 16:26:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Log-Contextual (Old)
and /work/SRC/openSUSE:Factory/.perl-Log-Contextual.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Log-Contextual"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Log-Contextual/perl-Log-Contextual.changes
2014-02-28 19:06:50.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Log-Contextual.new/perl-Log-Contextual.changes
2015-04-15 16:26:02.000000000 +0200
@@ -1,0 +2,14 @@
+Tue Apr 14 17:43:45 UTC 2015 - [email protected]
+
+- updated to 0.006005
+ see /usr/share/doc/packages/perl-Log-Contextual/Changes
+
+ 0.006005 2015-03-14 12:54:46-05:00 America/Chicago
+ - Fix performance (and arguably duplicate side effects!) in multilogger
setups
+ (Good catch and fix Christian Walde!)
+ - Fix warning introduced in 5.21.x
+
+ 0.006004 2014-07-15 21:50:41-05:00 America/Chicago
+ - Various POD fixes (Karent Etheridge, Florian Schlichting)
+
+-------------------------------------------------------------------
Old:
----
Log-Contextual-0.006003.tar.gz
New:
----
Log-Contextual-0.006005.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Log-Contextual.spec ++++++
--- /var/tmp/diff_new_pack.dvgwLM/_old 2015-04-15 16:26:02.000000000 +0200
+++ /var/tmp/diff_new_pack.dvgwLM/_new 2015-04-15 16:26:02.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Log-Contextual
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: perl-Log-Contextual
-Version: 0.006003
+Version: 0.006005
Release: 0
%define cpan_name Log-Contextual
Summary: Simple logging interface with a contextual log
@@ -69,23 +69,23 @@
'Log::Contextual' chooses which logger to use based on /LOGGER CODEREF.
Normally you don't need to know this, but you can take advantage of it
- when you need to later
+ when you need to later.
* * Scalable
- If you just want to add logging to your extremely basic application,
- start with the Log::Contextual::SimpleLogger manpage and then as your
- needs grow you can switch to the Log::Dispatchouli manpage or the
- Log::Dispatch manpage or the Log::Log4perl manpage or whatever else.
+ If you just want to add logging to your basic application, start with the
+ Log::Contextual::SimpleLogger manpage and then as your needs grow you can
+ switch to the Log::Dispatchouli manpage or the Log::Dispatch manpage or
+ the Log::Log4perl manpage or whatever else.
This module is a simple interface to extensible logging. It exists to
abstract your logging interface so that logging is as painless as possible,
while still allowing you to switch from one logger to another.
It is bundled with a really basic logger, the Log::Contextual::SimpleLogger
-manpage, but in general you should use a real logger instead of that. For
-something more serious but not overly complicated, try the
-Log::Dispatchouli manpage (see the /SYNOPSIS manpage for example.)
+manpage, but in general you should use a real logger instead. For something
+more serious but not overly complicated, try the Log::Dispatchouli manpage
+(see the /SYNOPSIS manpage for example.)
%prep
%setup -q -n %{cpan_name}-%{version}
@@ -104,6 +104,6 @@
%files -f %{name}.files
%defattr(-,root,root,755)
-%doc Changes CONTRIBUTING cpanfile LICENSE README
+%doc Changes CONTRIBUTING LICENSE README
%changelog
++++++ Log-Contextual-0.006003.tar.gz -> Log-Contextual-0.006005.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Log-Contextual-0.006003/Changes
new/Log-Contextual-0.006005/Changes
--- old/Log-Contextual-0.006003/Changes 2014-02-22 16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/Changes 2015-03-14 18:54:48.000000000 +0100
@@ -1,5 +1,13 @@
Revision history for Log-Contextual
+0.006005 2015-03-14 12:54:46-05:00 America/Chicago
+ - Fix performance (and arguably duplicate side effects!) in multilogger setups
+ (Good catch and fix Christian Walde!)
+ - Fix warning introduced in 5.21.x
+
+0.006004 2014-07-15 21:50:41-05:00 America/Chicago
+ - Various POD fixes (Karent Etheridge, Florian Schlichting)
+
0.006003 2014-02-22 09:41:29CST-0600 America/Chicago
- Stop depending on XS module Sub::Identify
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Log-Contextual-0.006003/LICENSE
new/Log-Contextual-0.006005/LICENSE
--- old/Log-Contextual-0.006003/LICENSE 2014-02-22 16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/LICENSE 2015-03-14 18:54:48.000000000 +0100
@@ -1,4 +1,4 @@
-This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
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 Arthur Axel "fREW" Schmidt.
+This software is Copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
This is free software, licensed under:
@@ -22,7 +22,7 @@
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
- 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -272,7 +272,7 @@
--- The Artistic License 1.0 ---
-This software is Copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is Copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
This is free software, licensed under:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Log-Contextual-0.006003/MANIFEST
new/Log-Contextual-0.006005/MANIFEST
--- old/Log-Contextual-0.006003/MANIFEST 2014-02-22 16:41:33.000000000
+0100
+++ new/Log-Contextual-0.006005/MANIFEST 2015-03-14 18:54:48.000000000
+0100
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest
v5.013.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest
v5.032.
CONTRIBUTING
Changes
LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Log-Contextual-0.006003/META.json
new/Log-Contextual-0.006005/META.json
--- old/Log-Contextual-0.006003/META.json 2014-02-22 16:41:33.000000000
+0100
+++ new/Log-Contextual-0.006005/META.json 2015-03-14 18:54:48.000000000
+0100
@@ -4,19 +4,19 @@
"Arthur Axel \"fREW\" Schmidt <[email protected]>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 5.013, CPAN::Meta::Converter version
2.120921",
+ "generated_by" : "Dist::Zilla version 5.032, CPAN::Meta::Converter version
2.143240",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
- "version" : "2"
+ "version" : 2
},
"name" : "Log-Contextual",
"prereqs" : {
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : "6.30"
+ "ExtUtils::MakeMaker" : "0"
}
},
"develop" : {
@@ -51,6 +51,6 @@
"web" : "https://github.com/frioux/Log-Contextual"
}
},
- "version" : "0.006003"
+ "version" : "0.006005"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Log-Contextual-0.006003/META.yml
new/Log-Contextual-0.006005/META.yml
--- old/Log-Contextual-0.006003/META.yml 2014-02-22 16:41:33.000000000
+0100
+++ new/Log-Contextual-0.006005/META.yml 2015-03-14 18:54:48.000000000
+0100
@@ -1,26 +1,26 @@
---
abstract: 'Simple logging interface with a contextual log'
author:
- - "Arthur Axel \"fREW\" Schmidt <[email protected]>"
+ - 'Arthur Axel "fREW" Schmidt <[email protected]>'
build_requires:
- Test::Fatal: 0
+ Test::Fatal: '0'
configure_requires:
- ExtUtils::MakeMaker: 6.30
+ ExtUtils::MakeMaker: '0'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.013, CPAN::Meta::Converter version
2.120921'
+generated_by: 'Dist::Zilla version 5.032, CPAN::Meta::Converter version
2.143240'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: '1.4'
name: Log-Contextual
requires:
- Carp: 0
- Data::Dumper::Concise: 0
- Exporter::Declare: 0.111
- Moo: 1.003
- Scalar::Util: 0
+ Carp: '0'
+ Data::Dumper::Concise: '0'
+ Exporter::Declare: '0.111'
+ Moo: '1.003'
+ Scalar::Util: '0'
resources:
bugtracker: https://github.com/frioux/Log-Contextual/issues
homepage: https://github.com/frioux/Log-Contextual
repository: https://github.com/frioux/Log-Contextual.git
-version: 0.006003
+version: '0.006005'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Log-Contextual-0.006003/Makefile.PL
new/Log-Contextual-0.006005/Makefile.PL
--- old/Log-Contextual-0.006003/Makefile.PL 2014-02-22 16:41:33.000000000
+0100
+++ new/Log-Contextual-0.006005/Makefile.PL 2015-03-14 18:54:48.000000000
+0100
@@ -1,20 +1,16 @@
-
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker
v5.013.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker
v5.032.
use strict;
use warnings;
-use ExtUtils::MakeMaker 6.30;
-
-
+use ExtUtils::MakeMaker;
my %WriteMakefileArgs = (
"ABSTRACT" => "Simple logging interface with a contextual log",
"AUTHOR" => "Arthur Axel \"fREW\" Schmidt <frioux+cpan\@gmail.com>",
- "BUILD_REQUIRES" => {},
"CONFIGURE_REQUIRES" => {
- "ExtUtils::MakeMaker" => "6.30"
+ "ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "Log-Contextual",
"EXE_FILES" => [],
@@ -30,7 +26,7 @@
"TEST_REQUIRES" => {
"Test::Fatal" => 0
},
- "VERSION" => "0.006003",
+ "VERSION" => "0.006005",
"test" => {
"TESTS" => "t/*.t"
}
@@ -41,6 +37,7 @@
"Carp" => 0,
"Data::Dumper::Concise" => 0,
"Exporter::Declare" => "0.111",
+ "ExtUtils::MakeMaker" => 0,
"Moo" => "1.003",
"Scalar::Util" => 0,
"Test::Fatal" => 0
@@ -57,6 +54,3 @@
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
-
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Log-Contextual-0.006003/README
new/Log-Contextual-0.006005/README
--- old/Log-Contextual-0.006003/README 2014-02-22 16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/README 2015-03-14 18:54:48.000000000 +0100
@@ -1,29 +1,24 @@
-NAME
- Log::Contextual - Simple logging interface with a contextual log
-
-VERSION
- version 0.006003
-
SYNOPSIS
+
use Log::Contextual qw( :log :dlog set_logger with_logger );
use Log::Contextual::SimpleLogger;
use Log::Log4perl ':easy';
Log::Log4perl->easy_init($DEBUG);
-
+
my $logger = Log::Log4perl->get_logger;
-
+
set_logger $logger;
-
+
log_debug { 'program started' };
-
+
sub foo {
-
+
my $minilogger = Log::Contextual::SimpleLogger->new({
levels => [qw( trace debug )]
});
-
+
my @args = @_;
-
+
with_logger $minilogger => sub {
log_trace { 'foo entered' };
my ($foo, $bar) = Dlog_trace { "params for foo: $_" } @args;
@@ -31,11 +26,11 @@
log_trace { 'foo left' };
};
}
-
+
foo();
- Beginning with version 1.008 Log::Dispatchouli also works out of the box
- with "Log::Contextual":
+ Beginning with version 1.008 Log::Dispatchouli also works out of the
+ box with Log::Contextual:
use Log::Contextual qw( :log :dlog set_logger );
use Log::Dispatchouli;
@@ -44,15 +39,16 @@
to_stderr => 1,
debug => 1,
});
-
+
set_logger $ld;
-
+
log_debug { 'program started' };
DESCRIPTION
+
Major benefits:
- * Efficient
+ * Efficient
The logging functions take blocks, so if a log level is disabled, the
block will not run:
@@ -60,45 +56,47 @@
# the following won't run if debug is off
log_debug { "the new count in the database is " . $rs->count };
- Similarly, the "D" prefixed methods only "Dumper" the input if the
- level is enabled.
+ Similarly, the D prefixed methods only Dumper the input if the level
+ is enabled.
- * Handy
+ * Handy
- The logging functions return their arguments, so you can stick them in
- the middle of expressions:
+ The logging functions return their arguments, so you can stick them
+ in the middle of expressions:
for (log_debug { "downloading:\n" . join qq(\n), @_ } @urls) { ... }
- * Generic
+ * Generic
- "Log::Contextual" is an interface for all major loggers. If you log
- through "Log::Contextual" you will be able to swap underlying loggers
+ Log::Contextual is an interface for all major loggers. If you log
+ through Log::Contextual you will be able to swap underlying loggers
later.
- * Powerful
+ * Powerful
- "Log::Contextual" chooses which logger to use based on user defined
- "CodeRef"s. Normally you don't need to know this, but you can take
- advantage of it when you need to later
-
- * Scalable
-
- If you just want to add logging to your extremely basic application,
- start with Log::Contextual::SimpleLogger and then as your needs grow
- you can switch to Log::Dispatchouli or Log::Dispatch or Log::Log4perl
- or whatever else.
+ Log::Contextual chooses which logger to use based on user defined
+ CodeRefs. Normally you don't need to know this, but you can take
+ advantage of it when you need to later.
+
+ * Scalable
+
+ If you just want to add logging to your basic application, start with
+ Log::Contextual::SimpleLogger and then as your needs grow you can
+ switch to Log::Dispatchouli or Log::Dispatch or Log::Log4perl or
+ whatever else.
This module is a simple interface to extensible logging. It exists to
abstract your logging interface so that logging is as painless as
- possible, while still allowing you to switch from one logger to another.
+ possible, while still allowing you to switch from one logger to
+ another.
- It is bundled with a really basic logger, Log::Contextual::SimpleLogger,
- but in general you should use a real logger instead of that. For
- something more serious but not overly complicated, try Log::Dispatchouli
- (see "SYNOPSIS" for example.)
+ It is bundled with a really basic logger,
+ Log::Contextual::SimpleLogger, but in general you should use a real
+ logger instead. For something more serious but not overly complicated,
+ try Log::Dispatchouli (see "SYNOPSIS" for example.)
A WORK IN PROGRESS
+
This module is certainly not complete, but we will not break the
interface lightly, so I would say it's safe to use in production code.
The main result from that at this point is that doing:
@@ -106,16 +104,18 @@
use Log::Contextual;
will die as we do not yet know what the defaults should be. If it turns
- out that nearly everyone uses the ":log" tag and ":dlog" is really rare,
- we'll probably make ":log" the default. But only time and usage will
+ out that nearly everyone uses the :log tag and :dlog is really rare,
+ we'll probably make :log the default. But only time and usage will
tell.
IMPORT OPTIONS
+
See "SETTING DEFAULT IMPORT OPTIONS" for information on setting these
project wide.
- -logger
- When you import this module you may use "-logger" as a shortcut for
+ -logger
+
+ When you import this module you may use -logger as a shortcut for
"set_logger", for example:
use Log::Contextual::SimpleLogger;
@@ -129,22 +129,24 @@
BEGIN { $var_log = VarLogger->new }
use Log::Contextual qw( :dlog ), -logger => $var_log;
- -levels
- The "-levels" import option allows you to define exactly which levels
- your logger supports. So the default, "[qw(debug trace warn info error
- fatal)]", works great for Log::Log4perl, but it doesn't support the
+ -levels
+
+ The -levels import option allows you to define exactly which levels
+ your logger supports. So the default, [qw(debug trace warn info error
+ fatal)], works great for Log::Log4perl, but it doesn't support the
levels for Log::Dispatch. But supporting those levels is as easy as
doing
use Log::Contextual
-levels => [qw( debug info notice warning error critical alert
emergency )];
- -package_logger
- The "-package_logger" import option is similar to the "-logger" import
- option except "-package_logger" sets the logger for the current package.
+ -package_logger
+
+ The -package_logger import option is similar to the -logger import
+ option except -package_logger sets the logger for the current package.
- Unlike "-default_logger", "-package_logger" cannot be overridden with
- "set_logger".
+ Unlike "-default_logger", -package_logger cannot be overridden with
+ "set_logger" or "with_logger".
package My::Package;
use Log::Contextual::SimpleLogger;
@@ -153,16 +155,17 @@
env_prefix => 'MY_PACKAGE'
});
- If you are interested in using this package for a module you are putting
- on CPAN we recommend Log::Contextual::WarnLogger for your package
- logger.
-
- -default_logger
- The "-default_logger" import option is similar to the "-logger" import
- option except "-default_logger" sets the default logger for the current
+ If you are interested in using this package for a module you are
+ putting on CPAN we recommend Log::Contextual::WarnLogger for your
+ package logger.
+
+ -default_logger
+
+ The -default_logger import option is similar to the -logger import
+ option except -default_logger sets the default logger for the current
package.
- Basically it sets the logger to be used if "set_logger" is never called;
+ Basically it sets the logger to be used if set_logger is never called;
so
package My::Package;
@@ -173,74 +176,78 @@
});
SETTING DEFAULT IMPORT OPTIONS
+
Eventually you will get tired of writing the following in every single
one of your packages:
use Log::Log4perl;
use Log::Log4perl ':easy';
BEGIN { Log::Log4perl->easy_init($DEBUG) }
-
+
use Log::Contextual -logger => Log::Log4perl->get_logger;
You can set any of the import options for your whole project if you
- define your own "Log::Contextual" subclass as follows:
+ define your own Log::Contextual subclass as follows:
package MyApp::Log::Contextual;
-
+
use base 'Log::Contextual';
-
+
use Log::Log4perl ':easy';
Log::Log4perl->easy_init($DEBUG)
-
+
sub arg_default_logger { $_[1] || Log::Log4perl->get_logger }
sub arg_levels { [qw(debug trace warn info error fatal custom_level)] }
sub default_import { ':log' }
-
+
# or maybe instead of default_logger
sub arg_package_logger { $_[1] }
-
+
# and almost definitely not this, which is only here for completeness
sub arg_logger { $_[1] }
- Note the "$_[1] ||" in "arg_default_logger". All of these methods are
+ Note the $_[1] || in arg_default_logger. All of these methods are
passed the values passed in from the arguments to the subclass, so you
- can either throw them away, honor them, die on usage, or whatever. To be
- clear, if you define your subclass, and someone uses it as follows:
+ can either throw them away, honor them, die on usage, etc. To be clear,
+ if you define your subclass, and someone uses it as follows:
use MyApp::Log::Contextual -default_logger => $foo,
-levels => [qw(bar baz biff)];
- Your "arg_default_logger" method will get $foo and your "arg_levels"
- will get "[qw(bar baz biff)]";
+ Your arg_default_logger method will get $foo and your arg_levels will
+ get [qw(bar baz biff)];
- Additionally, the "default_import" method is what happens if a user
- tries to use your subclass with no arguments. The default just dies, but
- if you'd like to change the default to import a tag merely return the
- tags you'd like to import. So the following will all work:
+ Additionally, the default_import method is what happens if a user tries
+ to use your subclass with no arguments. The default just dies, but if
+ you'd like to change the default to import a tag merely return the tags
+ you'd like to import. So the following will all work:
sub default_import { ':log' }
-
+
sub default_import { ':dlog' }
-
+
sub default_import { qw(:dlog :log ) }
See Log::Contextual::Easy::Default for an example of a subclass of
- "Log::Contextual" that makes use of default import options.
+ Log::Contextual that makes use of default import options.
FUNCTIONS
- set_logger
+
+ set_logger
+
my $logger = WarnLogger->new;
set_logger $logger;
Arguments: "LOGGER CODEREF"
- "set_logger" will just set the current logger to whatever you pass it.
- It expects a "CodeRef", but if you pass it something else it will wrap
- it in a "CodeRef" for you. "set_logger" is really meant only to be
- called from a top-level script. To avoid foot-shooting the function will
- warn if you call it more than once.
+ set_logger will just set the current logger to whatever you pass it. It
+ expects a CodeRef, but if you pass it something else it will wrap it in
+ a CodeRef for you. set_logger is really meant only to be called from a
+ top-level script. To avoid foot-shooting the function will warn if you
+ call it more than once.
+
+ with_logger
- with_logger
my $logger = WarnLogger->new;
with_logger $logger => sub {
if (1 == 0) {
@@ -250,18 +257,19 @@
}
};
- Arguments: "LOGGER CODEREF", "CodeRef $to_execute"
+ Arguments: "LOGGER CODEREF", CodeRef $to_execute
+
+ with_logger sets the logger for the scope of the CodeRef $to_execute.
+ As with "set_logger", with_logger will wrap $returning_logger with a
+ CodeRef if needed.
- "with_logger" sets the logger for the scope of the "CodeRef"
- $to_execute. As with "set_logger", "with_logger" will wrap
- $returning_logger with a "CodeRef" if needed.
+ log_$level
- log_$level
- Import Tag: ":log"
+ Import Tag: :log
- Arguments: "CodeRef $returning_message, @args"
+ Arguments: CodeRef $returning_message, @args
- "log_$level" functions all work the same except that a different method
+ log_$level functions all work the same except that a different method
is called on the underlying $logger object. The basic pattern is:
sub log_$level (&@) {
@@ -272,8 +280,8 @@
}
Note that the function returns it's arguments. This can be used in a
- number of ways, but often it's convenient just for partial inspection of
- passthrough data
+ number of ways, but often it's convenient just for partial inspection
+ of passthrough data
my @friends = log_trace {
'friends list being generated, data from first friend: ' .
@@ -284,19 +292,25 @@
"Dlog_$level" functions.
Which functions are exported depends on what was passed to "-levels".
- The default (no "-levels" option passed) would export:
+ The default (no -levels option passed) would export:
log_trace
+
log_debug
+
log_info
+
log_warn
+
log_error
+
log_fatal
- logS_$level
- Import Tag: ":log"
+ logS_$level
+
+ Import Tag: :log
- Arguments: "CodeRef $returning_message, Item $arg"
+ Arguments: CodeRef $returning_message, Item $arg
This is really just a special case of the "log_$level" functions. It
forces scalar context when that is what you need. Other than that it
@@ -308,10 +322,11 @@
See also: "DlogS_$level".
- Dlog_$level
- Import Tag: ":dlog"
+ Dlog_$level
- Arguments: "CodeRef $returning_message, @args"
+ Import Tag: :dlog
+
+ Arguments: CodeRef $returning_message, @args
All of the following six functions work the same as their "log_$level"
brethren, except they return what is passed into them and put the
@@ -329,37 +344,45 @@
"fiSMBoC"
Which functions are exported depends on what was passed to "-levels".
- The default (no "-levels" option passed) would export:
+ The default (no -levels option passed) would export:
Dlog_trace
+
Dlog_debug
+
Dlog_info
+
Dlog_warn
+
Dlog_error
+
Dlog_fatal
- DlogS_$level
- Import Tag: ":dlog"
+ DlogS_$level
+
+ Import Tag: :dlog
- Arguments: "CodeRef $returning_message, Item $arg"
+ Arguments: CodeRef $returning_message, Item $arg
- Like "logS_$level", these functions are a special case of "Dlog_$level".
- They only take a single scalar after the $returning_message instead of
- slurping up (and also setting "wantarray") all the @args
+ Like "logS_$level", these functions are a special case of
+ "Dlog_$level". They only take a single scalar after the
+ $returning_message instead of slurping up (and also setting wantarray)
+ all the @args
my $pals_rs = DlogS_debug { "pals resultset: $_" }
$schema->resultset('Pals')->search({ perlers => 1 });
LOGGER CODEREF
+
Anywhere a logger object can be passed, a coderef is accepted. This is
so that the user can use different logger objects based on runtime
- information. The logger coderef is passed the package of the caller the
- caller level the coderef needs to use if it wants more caller
- information. The latter is in a hashref to allow for more options in the
- future.
+ information. The logger coderef is passed the package of the caller,
+ and the caller level the coderef needs to use if it wants more caller
+ information. The latter is in a hashref to allow for more options in
+ the future.
- Here is a basic example of a logger that exploits "caller" to reproduce
- the output of "warn" with a logger:
+ Here is a basic example of a logger that exploits caller to reproduce
+ the output of warn with a logger:
my @caller_info;
my $var_log = Log::Contextual::SimpleLogger->new({
@@ -375,19 +398,19 @@
log_debug { 'test' };
The following is an example that uses the information passed to the
- logger coderef. It sets the global logger to $l3, the logger for the
- "A1" package to $l1, except the "lol" method in "A1" which uses the $l2
- logger and lastly the logger for the "A2" package to $l2.
+ logger coderef. It sets the global logger to $l3, the logger for the A1
+ package to $l1, except the lol method in A1 which uses the $l2 logger
+ and lastly the logger for the A2 package to $l2.
Note that it increases the caller level as it dispatches based on where
the caller of the log function, not the log function itself.
my $complex_dispatcher = do {
-
+
my $l1 = ...;
my $l2 = ...;
my $l3 = ...;
-
+
my %registry = (
-logger => $l3,
A1 => {
@@ -396,10 +419,10 @@
},
A2 => { -logger => $l2 },
);
-
+
sub {
my ( $package, $info ) = @_;
-
+
my $logger = $registry{'-logger'};
if (my $r = $registry{$package}) {
$logger = $r->{'-logger'} if $r->{'-logger'};
@@ -410,10 +433,11 @@
return $logger;
}
};
-
+
set_logger $complex_dispatcher;
LOGGER INTERFACE
+
Because this module is ultimately pretty looking glue (glittery?) with
the awesome benefit of the Contextual part, users will often want to
make their favorite logger work with it. The following are the methods
@@ -438,12 +462,13 @@
Log::Contextual::SimpleLogger.
LOG ROUTING
+
In between the loggers and the log functions is a log router that is
- responsible for finding a logger to handle the log event and passing the
- log information to the logger. This relationship is described in the
- documentation for "Log::Contextual::Role::Router".
+ responsible for finding a logger to handle the log event and passing
+ the log information to the logger. This relationship is described in
+ the documentation for Log::Contextual::Role::Router.
- "Log::Contextual" and packages that extend it will by default share a
+ Log::Contextual and packages that extend it will by default share a
router singleton that implements the with_logger() and set_logger()
functions and also respects the -logger, -package_logger, and
-default_logger import options with their associated default value
@@ -453,19 +478,12 @@
loggers that use a different interface.
CONTRIBUTORS
+
triddle - Tyler Riddle <[email protected]>
voj - Jakob Voß <[email protected]>
DESIGNER
- mst - Matt S. Trout <[email protected]>
-AUTHOR
- Arthur Axel "fREW" Schmidt <[email protected]>
-
-COPYRIGHT AND LICENSE
- This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
-
- This is free software; you can redistribute it and/or modify it under
- the same terms as the Perl 5 programming language system itself.
+ mst - Matt S. Trout <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Log-Contextual-0.006003/dist.ini
new/Log-Contextual-0.006005/dist.ini
--- old/Log-Contextual-0.006003/dist.ini 2014-02-22 16:41:33.000000000
+0100
+++ new/Log-Contextual-0.006005/dist.ini 2015-03-14 18:54:48.000000000
+0100
@@ -2,7 +2,7 @@
author = Arthur Axel "fREW" Schmidt <[email protected]>
license = Perl_5
copyright_holder = Arthur Axel "fREW" Schmidt
-version = 0.006003
+version = 0.006005
[NextRelease]
[@Git]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Log-Contextual-0.006003/lib/Log/Contextual/Easy/Default.pm
new/Log-Contextual-0.006005/lib/Log/Contextual/Easy/Default.pm
--- old/Log-Contextual-0.006003/lib/Log/Contextual/Easy/Default.pm
2014-02-22 16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/lib/Log/Contextual/Easy/Default.pm
2015-03-14 18:54:48.000000000 +0100
@@ -1,5 +1,5 @@
package Log::Contextual::Easy::Default;
-$Log::Contextual::Easy::Default::VERSION = '0.006003';
+$Log::Contextual::Easy::Default::VERSION = '0.006005';
# ABSTRACT: Import all logging methods with WarnLogger as default
use strict;
@@ -34,7 +34,7 @@
=head1 VERSION
-version 0.006003
+version 0.006005
=head1 SYNOPSIS
@@ -82,7 +82,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
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-Contextual-0.006003/lib/Log/Contextual/Easy/Package.pm
new/Log-Contextual-0.006005/lib/Log/Contextual/Easy/Package.pm
--- old/Log-Contextual-0.006003/lib/Log/Contextual/Easy/Package.pm
2014-02-22 16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/lib/Log/Contextual/Easy/Package.pm
2015-03-14 18:54:48.000000000 +0100
@@ -1,5 +1,5 @@
package Log::Contextual::Easy::Package;
-$Log::Contextual::Easy::Package::VERSION = '0.006003';
+$Log::Contextual::Easy::Package::VERSION = '0.006005';
# ABSTRACT: Import all logging methods with WarnLogger as default package
logger
use strict;
@@ -34,7 +34,7 @@
=head1 VERSION
-version 0.006003
+version 0.006005
=head1 SYNOPSIS
@@ -82,7 +82,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
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-Contextual-0.006003/lib/Log/Contextual/Role/Router/SetLogger.pm
new/Log-Contextual-0.006005/lib/Log/Contextual/Role/Router/SetLogger.pm
--- old/Log-Contextual-0.006003/lib/Log/Contextual/Role/Router/SetLogger.pm
2014-02-22 16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/lib/Log/Contextual/Role/Router/SetLogger.pm
2015-03-14 18:54:48.000000000 +0100
@@ -1,5 +1,7 @@
package Log::Contextual::Role::Router::SetLogger;
-$Log::Contextual::Role::Router::SetLogger::VERSION = '0.006003';
+$Log::Contextual::Role::Router::SetLogger::VERSION = '0.006005';
+# ABSTRACT: Abstract interface between loggers and logging code blocks
+
use Moo::Role;
requires 'set_logger';
@@ -14,11 +16,11 @@
=head1 NAME
-Log::Contextual::Role::Router::SetLogger
+Log::Contextual::Role::Router::SetLogger - Abstract interface between loggers
and logging code blocks
=head1 VERSION
-version 0.006003
+version 0.006005
=head1 AUTHOR
@@ -26,7 +28,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
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-Contextual-0.006003/lib/Log/Contextual/Role/Router/WithLogger.pm
new/Log-Contextual-0.006005/lib/Log/Contextual/Role/Router/WithLogger.pm
--- old/Log-Contextual-0.006003/lib/Log/Contextual/Role/Router/WithLogger.pm
2014-02-22 16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/lib/Log/Contextual/Role/Router/WithLogger.pm
2015-03-14 18:54:48.000000000 +0100
@@ -1,5 +1,7 @@
package Log::Contextual::Role::Router::WithLogger;
-$Log::Contextual::Role::Router::WithLogger::VERSION = '0.006003';
+$Log::Contextual::Role::Router::WithLogger::VERSION = '0.006005';
+# ABSTRACT: Abstract interface between loggers and logging code blocks
+
use Moo::Role;
requires 'with_logger';
@@ -14,11 +16,11 @@
=head1 NAME
-Log::Contextual::Role::Router::WithLogger
+Log::Contextual::Role::Router::WithLogger - Abstract interface between loggers
and logging code blocks
=head1 VERSION
-version 0.006003
+version 0.006005
=head1 AUTHOR
@@ -26,7 +28,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
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-Contextual-0.006003/lib/Log/Contextual/Role/Router.pm
new/Log-Contextual-0.006005/lib/Log/Contextual/Role/Router.pm
--- old/Log-Contextual-0.006003/lib/Log/Contextual/Role/Router.pm
2014-02-22 16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/lib/Log/Contextual/Role/Router.pm
2015-03-14 18:54:48.000000000 +0100
@@ -1,5 +1,5 @@
package Log::Contextual::Role::Router;
-$Log::Contextual::Role::Router::VERSION = '0.006003';
+$Log::Contextual::Role::Router::VERSION = '0.006005';
# ABSTRACT: Abstract interface between loggers and logging code blocks
use Moo::Role;
@@ -22,7 +22,7 @@
=head1 VERSION
-version 0.006003
+version 0.006005
=head1 SYNOPSIS
@@ -199,7 +199,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
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-Contextual-0.006003/lib/Log/Contextual/Router.pm
new/Log-Contextual-0.006005/lib/Log/Contextual/Router.pm
--- old/Log-Contextual-0.006003/lib/Log/Contextual/Router.pm 2014-02-22
16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/lib/Log/Contextual/Router.pm 2015-03-14
18:54:48.000000000 +0100
@@ -1,5 +1,7 @@
package Log::Contextual::Router;
-$Log::Contextual::Router::VERSION = '0.006003';
+$Log::Contextual::Router::VERSION = '0.006005';
+# ABSTRACT: Route messages to loggers
+
use Moo;
use Scalar::Util 'blessed';
@@ -134,9 +136,11 @@
$message_info{caller_level}++;
- foreach my $logger ($self->get_loggers(%message_info)) {
- $logger->$log_level($generator->(@$args));
- }
+ my @loggers = $self->get_loggers(%message_info)
+ or return;
+
+ my @log = $generator->(@$args);
+ $_->$log_level(@log) for @loggers;
}
1;
@@ -149,11 +153,11 @@
=head1 NAME
-Log::Contextual::Router
+Log::Contextual::Router - Route messages to loggers
=head1 VERSION
-version 0.006003
+version 0.006005
=head1 AUTHOR
@@ -161,7 +165,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
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-Contextual-0.006003/lib/Log/Contextual/SimpleLogger.pm
new/Log-Contextual-0.006005/lib/Log/Contextual/SimpleLogger.pm
--- old/Log-Contextual-0.006003/lib/Log/Contextual/SimpleLogger.pm
2014-02-22 16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/lib/Log/Contextual/SimpleLogger.pm
2015-03-14 18:54:48.000000000 +0100
@@ -1,8 +1,7 @@
package Log::Contextual::SimpleLogger;
-$Log::Contextual::SimpleLogger::VERSION = '0.006003';
+$Log::Contextual::SimpleLogger::VERSION = '0.006005';
# ABSTRACT: Super simple logger made for playing with Log::Contextual
-
use strict;
use warnings;
@@ -70,7 +69,7 @@
=head1 VERSION
-version 0.006003
+version 0.006005
=head1 SYNOPSIS
@@ -199,7 +198,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
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-Contextual-0.006003/lib/Log/Contextual/TeeLogger.pm
new/Log-Contextual-0.006005/lib/Log/Contextual/TeeLogger.pm
--- old/Log-Contextual-0.006003/lib/Log/Contextual/TeeLogger.pm 2014-02-22
16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/lib/Log/Contextual/TeeLogger.pm 2015-03-14
18:54:48.000000000 +0100
@@ -1,5 +1,5 @@
package Log::Contextual::TeeLogger;
-$Log::Contextual::TeeLogger::VERSION = '0.006003';
+$Log::Contextual::TeeLogger::VERSION = '0.006005';
# ABSTRACT: Output to more than one logger
use strict;
@@ -54,7 +54,7 @@
=head1 VERSION
-version 0.006003
+version 0.006005
=head1 SYNOPSIS
@@ -179,7 +179,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
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-Contextual-0.006003/lib/Log/Contextual/WarnLogger.pm
new/Log-Contextual-0.006005/lib/Log/Contextual/WarnLogger.pm
--- old/Log-Contextual-0.006003/lib/Log/Contextual/WarnLogger.pm
2014-02-22 16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/lib/Log/Contextual/WarnLogger.pm
2015-03-14 18:54:48.000000000 +0100
@@ -1,5 +1,5 @@
package Log::Contextual::WarnLogger;
-$Log::Contextual::WarnLogger::VERSION = '0.006003';
+$Log::Contextual::WarnLogger::VERSION = '0.006005';
# ABSTRACT: logger for libraries using Log::Contextual
use strict;
@@ -129,7 +129,7 @@
=head1 VERSION
-version 0.006003
+version 0.006005
=head1 SYNOPSIS
@@ -287,7 +287,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
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-Contextual-0.006003/lib/Log/Contextual.pm
new/Log-Contextual-0.006005/lib/Log/Contextual.pm
--- old/Log-Contextual-0.006003/lib/Log/Contextual.pm 2014-02-22
16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/lib/Log/Contextual.pm 2015-03-14
18:54:48.000000000 +0100
@@ -1,5 +1,5 @@
package Log::Contextual;
-$Log::Contextual::VERSION = '0.006003';
+$Log::Contextual::VERSION = '0.006005';
# ABSTRACT: Simple logging interface with a contextual log
use strict;
@@ -19,6 +19,7 @@
ref $coderef or return;
my $cv = B::svref_2object($coderef);
$cv->isa('B::CV') or return;
+
# bail out if GV is undefined
$cv->GV->isa('B::SPECIAL') and return;
@@ -120,89 +121,67 @@
my @levels = @{$class->arg_levels($spec->config->{levels})};
for my $level (@levels) {
+ my %base =
+ (exporter => $class, caller_level => 1, message_level => $level);
+ my %exports;
if ($spec->config->{log} || $exports->{"&log_$level"}) {
- _maybe_export(
- $spec,
- $importer,
- "log_$level",
- sub (&@) {
- my ($code, @args) = @_;
- $router->handle_log_request(
- exporter => $class,
- caller_package => scalar(caller),
- caller_level => 1,
- message_level => $level,
- message_sub => $code,
- message_args => \@args,
- );
- return @args;
- },
- );
+ $exports{log_} = sub (&@) {
+ my ($code, @args) = @_;
+ $router->handle_log_request(
+ %base,
+ caller_package => scalar(caller),
+ message_sub => $code,
+ message_args => \@args,
+ );
+ return @args;
+ };
}
if ($spec->config->{log} || $exports->{"&logS_$level"}) {
- _maybe_export(
- $spec,
- $importer,
- "logS_$level",
- sub (&@) {
- my ($code, @args) = @_;
- $router->handle_log_request(
- exporter => $class,
- caller_package => scalar(caller),
- caller_level => 1,
- message_level => $level,
- message_sub => $code,
- message_args => \@args,
- );
- return $args[0];
- },
- );
+ $exports{logS_} = sub (&@) {
+ my ($code, @args) = @_;
+ $router->handle_log_request(
+ %base,
+ caller_package => scalar(caller),
+ message_sub => $code,
+ message_args => \@args,
+ );
+ return $args[0];
+ };
}
if ($spec->config->{dlog} || $exports->{"&Dlog_$level"}) {
- _maybe_export(
- $spec,
- $importer,
- "Dlog_$level",
- sub (&@) {
- my ($code, @args) = @_;
- my $wrapped = sub {
- local $_ = (@_ ? Data::Dumper::Concise::Dumper @_ : '()');
- &$code;
- };
- $router->handle_log_request(
- exporter => $class,
- caller_package => scalar(caller),
- caller_level => 1,
- message_level => $level,
- message_sub => $wrapped,
- message_args => \@args,
- );
- return @args;
- },
- );
+ $exports{Dlog_} = sub (&@) {
+ my ($code, @args) = @_;
+ my $wrapped = sub {
+ local $_ = (@_ ? Data::Dumper::Concise::Dumper @_ : '()');
+ &$code;
+ };
+ $router->handle_log_request(
+ %base,
+ caller_package => scalar(caller),
+ message_sub => $wrapped,
+ message_args => \@args,
+ );
+ return @args;
+ };
}
if ($spec->config->{dlog} || $exports->{"&DlogS_$level"}) {
- _maybe_export(
- $spec,
- $importer,
- "DlogS_$level",
- sub (&$) {
- my ($code, $ref) = @_;
- my $wrapped = sub {
- local $_ = Data::Dumper::Concise::Dumper($_[0]);
- &$code;
- };
- $router->handle_log_request(
- exporter => $class,
- caller_package => scalar(caller),
- caller_level => 1,
- message_level => $level,
- message_sub => $wrapped,
- message_args => [$ref],
- );
- return $ref;
- });
+ $exports{DlogS_} = sub (&$) {
+ my ($code, $ref) = @_;
+ my $wrapped = sub {
+ local $_ = Data::Dumper::Concise::Dumper($_[0]);
+ &$code;
+ };
+ $router->handle_log_request(
+ %base,
+ caller_package => scalar(caller),
+ message_sub => $wrapped,
+ message_args => [$ref],
+ );
+ return $ref;
+ };
}
+ _maybe_export($spec, $importer, $_ . $level, $exports{$_})
+ for keys %exports;
}
}
@@ -240,7 +219,7 @@
=head1 VERSION
-version 0.006003
+version 0.006005
=head1 SYNOPSIS
@@ -321,11 +300,11 @@
C<Log::Contextual> chooses which logger to use based on L<< user defined
C<CodeRef>s|/LOGGER CODEREF >>.
Normally you don't need to know this, but you can take advantage of it when you
-need to later
+need to later.
=item * Scalable
-If you just want to add logging to your extremely basic application, start with
+If you just want to add logging to your basic application, start with
L<Log::Contextual::SimpleLogger> and then as your needs grow you can switch to
L<Log::Dispatchouli> or L<Log::Dispatch> or L<Log::Log4perl> or whatever else.
@@ -336,7 +315,7 @@
while still allowing you to switch from one logger to another.
It is bundled with a really basic logger, L<Log::Contextual::SimpleLogger>,
-but in general you should use a real logger instead of that. For something
+but in general you should use a real logger instead. For something
more serious but not overly complicated, try L<Log::Dispatchouli> (see
L</SYNOPSIS> for example.)
@@ -390,7 +369,7 @@
except C<-package_logger> sets the logger for the current package.
Unlike L</-default_logger>, C<-package_logger> cannot be overridden with
-L</set_logger>.
+L</set_logger> or L</with_logger>.
package My::Package;
use Log::Contextual::SimpleLogger;
@@ -449,7 +428,7 @@
Note the C<< $_[1] || >> in C<arg_default_logger>. All of these methods are
passed the values passed in from the arguments to the subclass, so you can
-either throw them away, honor them, die on usage, or whatever. To be clear,
+either throw them away, honor them, die on usage, etc. To be clear,
if you define your subclass, and someone uses it as follows:
use MyApp::Log::Contextual -default_logger => $foo,
@@ -623,7 +602,7 @@
Anywhere a logger object can be passed, a coderef is accepted. This is so
that the user can use different logger objects based on runtime information.
-The logger coderef is passed the package of the caller the caller level the
+The logger coderef is passed the package of the caller, and the caller level
the
coderef needs to use if it wants more caller information. The latter is in
a hashref to allow for more options in the future.
@@ -735,7 +714,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.
+This software is copyright (c) 2015 by Arthur Axel "fREW" Schmidt.
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-Contextual-0.006003/t/caller.t
new/Log-Contextual-0.006005/t/caller.t
--- old/Log-Contextual-0.006003/t/caller.t 2014-02-22 16:41:33.000000000
+0100
+++ new/Log-Contextual-0.006005/t/caller.t 2015-03-14 18:54:48.000000000
+0100
@@ -11,7 +11,7 @@
coderef => sub {
chomp($_[0]);
$var = "$_[0] at $caller_info[1] line $caller_info[2].\n"
- }
+ }
});
my $warn_faker = sub {
my ($package, $args) = @_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Log-Contextual-0.006003/t/warnlogger-with-levels.t
new/Log-Contextual-0.006005/t/warnlogger-with-levels.t
--- old/Log-Contextual-0.006003/t/warnlogger-with-levels.t 2014-02-22
16:41:33.000000000 +0100
+++ new/Log-Contextual-0.006005/t/warnlogger-with-levels.t 2015-03-14
18:54:48.000000000 +0100
@@ -72,7 +72,7 @@
local $ENV{BAR_UPTO} = 'foo';
like(
exception { $l->is_bar },
- qr/Unrecognized log level 'foo' in \$ENV{BAR_UPTO}/,
+ qr/Unrecognized log level 'foo' in \$ENV\{BAR_UPTO\}/,
'Cannot use an unrecognized log level in UPTO',
);
}