move logging to debug level
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 6 Sep 2006 18:08:30 +0000 (18:08 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 6 Sep 2006 18:08:30 +0000 (18:08 +0000)
git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@634 07558da8-63fa-0310-ba24-9fe276d99e06

conf/log.conf
lib/WebPAC/Input.pm

index 686aef7..86abada 100644 (file)
@@ -22,6 +22,7 @@ log4perl.rootLogger=INFO, LOG, SCREEN
 #log4perl.logger.WebPAC.Validate=DEBUG
 
 #log4perl.logger.WebPAC.Input=DEBUG
+log4perl.logger.WebPAC.Input.modify_record_regexps=DEBUG
 #log4perl.logger.WebPAC.Input.ISIS=DEBUG
 #log4perl.logger.WebPAC.Input.ISIS.fetch=DEBUG
 #log4perl.logger.WebPAC.Input.ISIS.open=DEBUG
index 4a5aa47..d254dcd 100644 (file)
@@ -551,25 +551,29 @@ sub modify_record_regexps {
 
        my $regexpes;
 
+       my $log = $self->_get_logger();
+
        foreach my $f (keys %$modify_record) {
-warn "--- f: $f\n";
+               $log->debug("field: $f");
+
                foreach my $sf (keys %{ $modify_record->{$f} }) {
-warn "---- sf: $sf\n";
+                       $log->debug("subfield: $sf");
+
                        foreach my $from (keys %{ $modify_record->{$f}->{$sf} }) {
                                my $to = $modify_record->{$f}->{$sf}->{$from};
                                #die "no field?" unless defined($to);
-warn "----- transform: |$from| -> |$to|\n";
+                               $log->debug("transform: |$from| -> |$to|");
 
                                if ($sf =~ /^\^/) {
                                        my $regex = 
-                                               's/\Q'. $sf .'\E([^\^]+)\Q'. $from .'\E([^\^]+)/'. $sf .'$1'. $to .'$2/g';
+                                               's/\Q'. $sf .'\E(.*?)\Q'. $from .'\E(.*?)/'. $sf .'$1'. $to .'$2/g';
                                        push @{ $regexpes->{$f} }, $regex;
-warn ">>>>> $regex [sf]\n";
+                                       $log->debug(">>>>> $regex [sf]");
                                } else {
                                        my $regex =
                                                's/\Q'. $from .'\E/'. $to .'/g';
                                        push @{ $regexpes->{$f} }, $regex;
-warn ">>>>> $regex [global]\n";
+                                       $log->debug(">>>>> $regex [global]");
                                }
 
                        }