Add commented-out logging.
[irspy-moved-to-github.git] / lib / ZOOM / IRSpy.pm
index fea7d59..21b1a0f 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: IRSpy.pm,v 1.11 2006-07-24 17:00:36 mike Exp $
+# $Id: IRSpy.pm,v 1.14 2006-07-27 15:51:05 mike Exp $
 
 package ZOOM::IRSpy;
 
@@ -148,17 +148,22 @@ sub initialise {
     }
 
     my $rs = $this->{conn}->search(new ZOOM::Query::CQL($this->{query}));
+    #print "size='", $rs->size(), "'\n";
     foreach my $i (1 .. $rs->size()) {
        my $target = _render_record($rs, $i-1, "id");
        my $zeerex = _render_record($rs, $i-1, "zeerex");
+       #print STDERR "making '$target' record with '$zeerex'\n";
        $target2record{lc($target)} =
            new ZOOM::IRSpy::Record($target, $zeerex);
+       push @{ $this->{targets} }, $target
+           if $this->{allrecords};
     }
 
     foreach my $target (keys %target2record) {
        my $record = $target2record{$target};
        if (!defined $record) {
            $this->log("irspy_debug", "made new record for '$target'");
+           #print STDERR "making '$target' record without zeerex\n";
            $target2record{$target} = new ZOOM::IRSpy::Record($target);
        } else {
            $this->log("irspy_debug", "using existing record for '$target'");
@@ -196,6 +201,7 @@ sub check {
     my $res = $this->_run_test("Main");
     foreach my $target (sort keys %{ $this->{target2record} }) {
        my $rec = $this->{target2record}->{$target};
+       # It's a shame that LibXML can't pretty-print this
        print STDERR "$target: zeerex='", $rec->{zeerex}, "' = \n",
            $rec->{zeerex}->toString(), "\n";
        ### Write record back to database, if modified.