diff -rN -u old-Log-Dispatch-2.13/Changes new-Log-Dispatch-2.13/Changes
--- old-Log-Dispatch-2.13/Changes 2006-11-14 17:44:45.000000000 -0500
+++ new-Log-Dispatch-2.13/Changes 2006-11-14 17:44:45.000000000 -0500
@@ -1,3 +1,6 @@
+- min_level can now be called after argument creation, to allow temporarily
+ lowering the logging level for one part of the application. (Mark Stosberg)
+
2.13 Sep 25, 2006
- No code changes, just added a SUPPORT section to the docs referring
diff -rN -u old-Log-Dispatch-2.13/lib/Log/Dispatch/Output.pm new-Log-Dispatch-2.13/lib/Log/Dispatch/Output.pm
--- old-Log-Dispatch-2.13/lib/Log/Dispatch/Output.pm 2006-11-14 17:44:45.000000000 -0500
+++ new-Log-Dispatch-2.13/lib/Log/Dispatch/Output.pm 2006-11-14 17:44:45.000000000 -0500
@@ -90,7 +90,12 @@
sub min_level
{
- my $self = shift;
+ my $self = shift;
+ my $level = shift;
+ if (defined $level) {
+ $self->{min_level} = $self->_level_as_number($level);
+ die "Invalid level specified for min_level" unless defined $self->{min_level};
+ }
return $self->{level_names}[ $self->{min_level} ];
}
@@ -249,8 +254,9 @@
Returns the object's name.
-=item * min_level
+=item * min_level ($)
+If there argument is provided, sets it as the new minimum level.
Returns the object's minimum log level.
=item * max_level
diff -rN -u old-Log-Dispatch-2.13/t/min_level.t new-Log-Dispatch-2.13/t/min_level.t
--- old-Log-Dispatch-2.13/t/min_level.t 1969-12-31 19:00:00.000000000 -0500
+++ new-Log-Dispatch-2.13/t/min_level.t 2006-11-14 17:44:45.000000000 -0500
@@ -0,0 +1,17 @@
+use Test::More 'no_plan';
+
+use Log::Dispatch;
+use Log::Dispatch::Screen;
+
+my $l = Log::Dispatch::Screen->new( name => 'foo',
+ min_level => 'warning', stderr => 0 );
+
+
+is($l->min_level, 'warning', "min_level is set by new");
+
+is($l->min_level('debug'), 'debug', "min_level can be set and returned");
+
+
+is($l->min_level, 'debug', "setting min_level sticks");
+
+