X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FStatistics.pm;h=42137bfdcb374c5730c5978aa3546ca59a4336b0;hb=8a3e2074f4cc6dddf03f7ed781cea8143cfa0acd;hp=e241ad4297d81f23e131d3efa83fdb148f3de65d;hpb=7f9a3f70074c5d4eb4e8260648f055b7556a7a4f;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/Statistics.pm b/lib/DBIx/Class/Storage/Statistics.pm index e241ad4..42137bf 100644 --- a/lib/DBIx/Class/Storage/Statistics.pm +++ b/lib/DBIx/Class/Storage/Statistics.pm @@ -3,18 +3,10 @@ package DBIx::Class::Storage::Statistics; use strict; use warnings; -# DO NOT edit away without talking to riba first, he will just put it back -# BEGIN pre-Moo2 import block -BEGIN { - my $initial_fatal_bits = (${^WARNING_BITS}||'') & $warnings::DeadBits{all}; - local $ENV{PERL_STRICTURES_EXTRA} = 0; - require Moo; Moo->import; - ${^WARNING_BITS} &= ( $initial_fatal_bits | ~ $warnings::DeadBits{all} ); -} -# END pre-Moo2 import block - -extends 'DBIx::Class'; use DBIx::Class::_Util qw(sigwarn_silencer qsub); +use IO::Handle (); +use Moo; +extends 'DBIx::Class'; use namespace::clean; =head1 NAME @@ -42,11 +34,14 @@ Returns a new L object. =head2 debugfh Sets or retrieves the filehandle used for trace/debug output. This should -be an IO::Handle compatible object (only the C method is used). Initially -should be set to STDERR - although see information on the -L environment variable. +be an L compatible object (only the +L<< print|IO::Handle/METHODS >> method is used). By +default it is initially set to STDERR - although see discussion of the +L environment variable. -As getter it will lazily open a filehandle for you if one is not already set. +Invoked as a getter it will lazily open a filehandle and set it to +L<< autoflush|perlvar/HANDLE->autoflush( EXPR ) >> (if one is not +already set). =cut @@ -82,6 +77,8 @@ sub _build_debugfh { $_[0]->_defaulted_to_stderr(1); } + $fh->autoflush(1); + $fh; } @@ -106,7 +103,7 @@ sub print { local $SIG{__WARN__} = sigwarn_silencer(qr/^Wide character in print/) if $self->_defaulted_to_stderr; - $fh->printflush($msg); + $fh->print($msg); } =head2 silence @@ -216,18 +213,22 @@ sub query_start { Called when a query finishes executing. Has the same arguments as query_start. =cut + sub query_end { my ($self, $string) = @_; } -1; - -=head1 AUTHOR AND CONTRIBUTORS +=head1 FURTHER QUESTIONS? -See L and L in DBIx::Class +Check the list of L. -=head1 LICENSE +=head1 COPYRIGHT AND LICENSE -You may distribute this code under the same terms as Perl itself. +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L. =cut + +1;