X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FStatistics.pm;h=22dcadc6f21a1f3bfb1d73d980ab493d3c7588f9;hb=ee356d004e088518205ac720b37c31a64c9cd861;hp=1ecf1fce77c6cdf05d75a292e480e39349688ed8;hpb=adb3554a3f72bf9c9b267c5eb84a8401da64bf37;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/Statistics.pm b/lib/DBIx/Class/Storage/Statistics.pm index 1ecf1fc..22dcadc 100644 --- a/lib/DBIx/Class/Storage/Statistics.pm +++ b/lib/DBIx/Class/Storage/Statistics.pm @@ -5,7 +5,7 @@ use warnings; use base qw/Class::Accessor::Grouped/; use IO::File; -__PACKAGE__->mk_group_accessors(simple => qw/callback debugfh/); +__PACKAGE__->mk_group_accessors(simple => qw/callback debugfh silence/); =head1 NAME @@ -56,6 +56,8 @@ to display the message. sub print { my ($self, $msg) = @_; + return if $self->silence; + if(!defined($self->debugfh())) { my $fh; my $debug_env = $ENV{DBIX_CLASS_STORAGE_DBI_DEBUG} @@ -75,6 +77,10 @@ sub print { $self->debugfh->print($msg); } +=head2 silence + +Turn off all output if set to true. + =head2 txn_begin Called when a transaction begins. @@ -124,7 +130,7 @@ sub svp_begin { Called when a savepoint is released. =cut -sub svn_release { +sub svp_release { my ($self, $name) = @_; $self->print("RELEASE SAVEPOINT $name\n");