X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FRecord.pm;h=29160ec6170078241f0dc8618b4d87e9d406ef16;hb=32f8933db25356a6d5c742530e70c7b4ae4f97e2;hp=7444d70014bcfb9868ae4fcd8ebb85d0755f8c91;hpb=7f4706a4bbb2a31f946c17173acef373a672a5b2;p=irspy-moved-to-github.git diff --git a/lib/ZOOM/IRSpy/Record.pm b/lib/ZOOM/IRSpy/Record.pm index 7444d70..29160ec 100644 --- a/lib/ZOOM/IRSpy/Record.pm +++ b/lib/ZOOM/IRSpy/Record.pm @@ -1,4 +1,3 @@ -# $Id: Record.pm,v 1.28 2007-12-12 08:49:58 mike Exp $ package ZOOM::IRSpy::Record; ### I don't think there's any reason for this to be separate from @@ -8,6 +7,7 @@ use 5.008; use strict; use warnings; +use Scalar::Util; use XML::LibXML; use XML::LibXML::XPathContext; use ZOOM::IRSpy::Utils qw(xml_encode isodate irspy_xpath_context); @@ -36,14 +36,21 @@ sub new { ### Parser should be in the IRSpy object my $parser = new XML::LibXML(); - return bless { + my $this = bless { irspy => $irspy, target => $target, parser => $parser, zeerex => $parser->parse_string($zeerex)->documentElement(), + zoom_error => { TIMEOUT => 0 }, }, $class; + + #Scalar::Util::weaken($this->{irspy}); + #Scalar::Util::weaken($this->{parser}); + + return $this; } +sub zoom_error { return shift->{'zoom_error'} } sub _empty_zeerex_record { my($target) = @_; @@ -110,9 +117,10 @@ sub store_result { $xml .= " $key=\"" . xml_encode($info{$key}) . "\""; } - $xml .= ">" . isodate(time()) . "\n"; + $xml .= ">" . isodate(time()) . ""; - $this->append_entry('irspy:status', $xml); + $this->{irspy}->log("irspy_data", $xml); + $this->append_entry('irspy:status', $xml . "\n"); }