# This is a patch for Log-Any-0.11.orig to update it to Log-Any-0.11
#
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
#
http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'patch' program with this file as input.
#
#### End of Preamble ####
#### Patch data follows ####
diff -c 'Log-Any-0.11.orig/lib/Log/Any.pm' 'Log-Any-0.11/lib/Log/Any.pm'
Index: ./lib/Log/Any.pm
*** ./lib/Log/Any.pm Fri Feb 12 07:46:09 2010
--- ./lib/Log/Any.pm Tue Nov 23 12:14:47 2010
***************
*** 4,13 ****
our $VERSION = '0.11';
- # Require rather than use, because it depends on subroutines defined below
- #
- require Log::Any::Adapter::Null;
-
# This is accessed in Log::Any::Adapter::Manager::new
#
our %NullAdapters;
--- 4,9 ----
***************
*** 24,41 ****
my $class = shift;
my $caller = shift;
# Parse parameters passed to 'use Log::Any'
#
my @vars;
! foreach my $param (@_) {
if ( $param eq '$log' ) {
! my $log = $class->get_logger( category => $caller );
no strict 'refs';
my $varname = "$caller\::log";
*$varname = \$log;
}
else {
! die "invalid import '$param' - valid imports are '\$log'";
}
}
}
--- 20,53 ----
my $class = shift;
my $caller = shift;
+ my $def_adapter;
+
# Parse parameters passed to 'use Log::Any'
#
+ my $skip = 0;
my @vars;
! while( @_ ) {
!
! my $param = shift( @_ );
!
if ( $param eq '$log' ) {
! my $log = $class->get_logger( category => $caller,
! def_adapter => $def_adapter
! );
no strict 'refs';
my $varname = "$caller\::log";
*$varname = \$log;
}
+ elsif ( $param eq 'default' ) {
+
+ die "import 'default' requires an argument"
+ unless @_;
+
+ $def_adapter = 'Log::Any::Adapter::' . shift( @_ );
+
+ }
else {
! die "invalid import '$param' - valid imports are '\$log' and 'default'";
}
}
}
***************
*** 47,61 ****
if ( !defined($category) ) {
$category = caller();
}
if ($Log::Any::Adapter::Initialized) {
return Log::Any::Adapter->get_logger( $category, %params );
}
else {
# Record each null adapter that we return, so that we can override
# them later if and when Log::Any::Adapter->set is called
#
! $NullAdapters{$category} ||= Log::Any::Adapter::Null->new();
return $NullAdapters{$category};
}
}
--- 59,80 ----
if ( !defined($category) ) {
$category = caller();
}
+
+ my $def_adapter = delete( $params{'def_adapter'}) || 'Log::Any::Adapter::Null';
+
if ($Log::Any::Adapter::Initialized) {
return Log::Any::Adapter->get_logger( $category, %params );
}
else {
+ # Require rather than use, because it depends on subroutines defined below
+ #
+ eval "require $def_adapter;" or die $@;
+
# Record each null adapter that we return, so that we can override
# them later if and when Log::Any::Adapter->set is called
#
! $NullAdapters{$category} ||= $def_adapter->new();
return $NullAdapters{$category};
}
}
#### End of Patch data ####
#### ApplyPatch data follows ####
# Data version : 1.0
# Date generated : Tue Nov 23 12:19:42 2010
# Generated by : makepatch 2.04
# Recurse directories : Yes
# Excluded files : (\A|/).*\~\Z
# (\A|/).*\.a\Z
# (\A|/).*\.bak\Z
# (\A|/).*\.BAK\Z
# (\A|/).*\.elc\Z
# (\A|/).*\.exe\Z
# (\A|/).*\.gz\Z
# (\A|/).*\.ln\Z
# (\A|/).*\.o\Z
# (\A|/).*\.obj\Z
# (\A|/).*\.olb\Z
# (\A|/).*\.old\Z
# (\A|/).*\.orig\Z
# (\A|/).*\.rej\Z
# (\A|/).*\.so\Z
# (\A|/).*\.Z\Z
# (\A|/)\.del\-.*\Z
# (\A|/)\.make\.state\Z
# (\A|/)\.nse_depinfo\Z
# (\A|/)core\Z
# (\A|/)tags\Z
# (\A|/)TAGS\Z
# p 'lib/Log/Any.pm' 10603 1290532487 0100644
#### End of ApplyPatch data ####
#### End of Patch kit [created: Tue Nov 23 12:19:42 2010] ####
#### Patch checksum: 146 4317 22006 ####
#### Checksum: 164 5008 13471 ####