From 083f90cc44c4c02d544a55feb321c07d4e44f86c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 22 Oct 2013 12:24:10 -0400 Subject: [PATCH] Bug 8015: (follow-up) remove references to C4::Koha::Log Signed-off-by: Galen Charlton --- C4/Koha.pm | 16 ---------------- C4/MarcModificationTemplates.pm | 16 ---------------- Koha/SimpleMARC.pm | 13 +------------ 3 files changed, 1 insertion(+), 44 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index fe288d00d8..937ac5f757 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -1486,22 +1486,6 @@ sub _isbn_cleanup { return; } -=head2 Log( $message ); - - Writes data to /tmp/koha.log. - - This is useful for debugging forked processes - that do not write to the apache error log - -=cut - -sub Log { - my ($data) = @_; - warn $data; - open my $fh, '>>', '/tmp/koha.log'; - print $fh "$data\n"; - close $fh; -} 1; __END__ diff --git a/C4/MarcModificationTemplates.pm b/C4/MarcModificationTemplates.pm index d26b76dd81..f504621908 100644 --- a/C4/MarcModificationTemplates.pm +++ b/C4/MarcModificationTemplates.pm @@ -17,11 +17,6 @@ package C4::MarcModificationTemplates; # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -## NOTE: -## Parts of this module are used from cgi scripts that are detached from apache before -## execution. For this reason, the C4::Koha::Log function has been used to capture -## output for debugging purposes. - use Modern::Perl; use DateTime; @@ -78,7 +73,6 @@ files telling Koha what fields to insert data into. sub GetModificationTemplates { my ( $template_id ) = @_; - C4::Koha::Log("C4::MarcModificationTemplates::GetModificationTemplates( $template_id )") if DEBUG; warn("C4::MarcModificationTemplates::GetModificationTemplates( $template_id )") if DEBUG; my $dbh = C4::Context->dbh; @@ -185,7 +179,6 @@ sub GetModificationTemplateAction { sub GetModificationTemplateActions { my ( $template_id ) = @_; - C4::Koha::Log( "C4::MarcModificationTemplates::GetModificationTemplateActions( $template_id )" ) if DEBUG; warn( "C4::MarcModificationTemplates::GetModificationTemplateActions( $template_id )" ) if DEBUG; my $dbh = C4::Context->dbh; @@ -197,7 +190,6 @@ sub GetModificationTemplateActions { push( @actions, $action ); } - C4::Koha::Log( Data::Dumper::Dumper( @actions ) ) if DEBUG > 4; warn( Data::Dumper::Dumper( @actions ) ) if DEBUG > 4; return @actions; @@ -241,10 +233,6 @@ sub AddModificationTemplateAction { $description ) = @_; - C4::Koha::Log( "C4::MarcModificationTemplates::AddModificationTemplateAction( $template_id, $action, - $field_number, $from_field, $from_subfield, $field_value, $to_field, $to_subfield, - $to_regex_search, $to_regex_replace, $to_regex_modifiers, $conditional, $conditional_field, $conditional_subfield, $conditional_comparison, - $conditional_value, $conditional_regex, $description )" ) if DEBUG; warn( "C4::MarcModificationTemplates::AddModificationTemplateAction( $template_id, $action, $field_number, $from_field, $from_subfield, $field_value, $to_field, $to_subfield, $to_regex_search, $to_regex_replace, $to_regex_modifiers, $conditional, $conditional_field, $conditional_subfield, $conditional_comparison, @@ -485,7 +473,6 @@ sub MoveModificationTemplateAction { sub ModifyRecordsWithTemplate { my ( $template_id, $batch ) = @_; - C4::Koha::Log( "C4::MarcModificationTemplates::ModifyRecordsWithTemplate( $template_id, $batch )" ) if DEBUG; warn( "C4::MarcModificationTemplates::ModifyRecordsWithTemplate( $template_id, $batch )" ) if DEBUG; while ( my $record = $batch->next() ) { @@ -504,9 +491,7 @@ sub ModifyRecordsWithTemplate { sub ModifyRecordWithTemplate { my ( $template_id, $record ) = @_; - C4::Koha::Log( "C4::MarcModificationTemplates::ModifyRecordWithTemplate( $template_id, $record )" ) if DEBUG; warn( "C4::MarcModificationTemplates::ModifyRecordWithTemplate( $template_id, $record )" ) if DEBUG; - C4::Koha::Log( "Unmodified Record:\n" . $record->as_formatted() ) if DEBUG >= 10; warn( "Unmodified Record:\n" . $record->as_formatted() ) if DEBUG >= 10; my $current_date = DateTime->now()->ymd(); @@ -607,7 +592,6 @@ sub ModifyRecordWithTemplate { } } - C4::Koha::Log( $record->as_formatted() ) if DEBUG >= 10; warn( $record->as_formatted() ) if DEBUG >= 10; } } diff --git a/Koha/SimpleMARC.pm b/Koha/SimpleMARC.pm index bd4c35e47e..2195143ccc 100644 --- a/Koha/SimpleMARC.pm +++ b/Koha/SimpleMARC.pm @@ -31,7 +31,7 @@ our $debug = 0; =head1 NAME -SimpleMARC - Perl modle for making simple MARC record alterations. +SimpleMARC - Perl module for making simple MARC record alterations. =head1 SYNOPSIS @@ -74,13 +74,11 @@ at your option, any later version of Perl 5 you may have available. sub copy_field { my ( $record, $fromFieldName, $fromSubfieldName, $toFieldName, $toSubfieldName, $regex, $n, $dont_erase ) = @_; - C4::Koha::Log( "C4::SimpleMARC::copy_field( '$record', '$fromFieldName', '$fromSubfieldName', '$toFieldName', '$toSubfieldName', '$regex', '$n' )" ) if $debug; if ( ! ( $record && $fromFieldName && $toFieldName ) ) { return; } my @values = read_field( $record, $fromFieldName, $fromSubfieldName ); @values = ( $values[$n-1] ) if ( $n ); - C4::Koha::Log( "@values = read_field( $record, $fromFieldName, $fromSubfieldName )" ) if $debug >= 3; if ( $regex and $regex->{search} ) { $regex->{modifiers} //= q||; @@ -91,7 +89,6 @@ sub copy_field { if grep {/$modifier/} @available_modifiers; } foreach my $value ( @values ) { - C4::Koha::Log( "\$value =~ s/$regex->{search}/$regex->{replace}/$modifiers" ) if ( $debug >= 3 ); for ( $modifiers ) { when ( /^(ig|gi)$/ ) { $value =~ s/$regex->{search}/$regex->{replace}/ig; @@ -127,7 +124,6 @@ sub copy_field { sub update_field { my ( $record, $fieldName, $subfieldName, $dont_erase, @values ) = @_; - C4::Koha::Log( "C4::SimpleMARC::update_field( $record, $fieldName, $subfieldName, $dont_erase, @values )" ) if $debug; if ( ! ( $record && $fieldName ) ) { return; } @@ -186,7 +182,6 @@ sub update_field { sub read_field { my ( $record, $fieldName, $subfieldName, $n ) = @_; - C4::Koha::Log( "C4::SimpleMARC::read_field( '$record', '$fieldName', '$subfieldName', '$n' )" ) if $debug; my @fields = $record->field( $fieldName ); @@ -215,7 +210,6 @@ sub read_field { sub field_exists { my ( $record, $fieldName, $subfieldName ) = @_; - C4::Koha::Log( "C4::SimpleMARC::field_exists( $record, $fieldName, $subfieldName )" ) if $debug; if ( ! $record ) { return; } @@ -226,7 +220,6 @@ sub field_exists { $return = $record->field( $fieldName ) && 1; } - C4::Koha::Log( "C4:SimpleMARC::field_exists: Returning '$return'" ) if $debug >= 2; return $return; } @@ -247,7 +240,6 @@ sub field_exists { sub field_equals { my ( $record, $value, $fieldName, $subfieldName, $regex, $n ) = @_; $n = 1 unless ( $n ); ## $n defaults to first field of a repeatable field series - C4::Koha::Log( "C4::SimpleMARC::field_equals( '$record', '$value', '$fieldName', '$subfieldName', '$regex', '$n')" ) if $debug; if ( ! $record ) { return; } @@ -255,7 +247,6 @@ sub field_equals { my $field_value = $field_values[$n-1]; if ( $regex ) { - C4::Koha::Log( "Testing '$field_value' =~ m/$value/" ) if $debug >= 3; return $field_value =~ m/$value/; } else { return $field_value eq $value; @@ -277,7 +268,6 @@ sub field_equals { sub move_field { my ( $record, $fromFieldName, $fromSubfieldName, $toFieldName, $toSubfieldName, $regex, $n ) = @_; - C4::Koha::Log( "C4::SimpleMARC::move_field( '$record', '$fromFieldName', '$fromSubfieldName', '$toFieldName', '$toSubfieldName', '$regex', '$n' )" ) if $debug; copy_field( $record, $fromFieldName, $fromSubfieldName, $toFieldName, $toSubfieldName, $regex, $n , 'dont_erase' ); delete_field( $record, $fromFieldName, $fromSubfieldName, $n ); } @@ -295,7 +285,6 @@ sub move_field { sub delete_field { my ( $record, $fieldName, $subfieldName, $n ) = @_; - C4::Koha::Log( "C4::SimpleMARC::delete_field( '$record', '$fieldName', '$subfieldName', '$n' )" ) if $debug; my @fields = $record->field( $fieldName ); -- 2.39.5