/[pxelator]/lib/PXElator/CouchDB.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/CouchDB.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 206 by dpavlin, Wed Aug 12 22:27:57 2009 UTC revision 207 by dpavlin, Wed Aug 12 22:56:45 2009 UTC
# Line 74  sub get { Line 74  sub get {
74    
75  sub put {  sub put {
76          my ($self, $url, $json) = @_;          my ($self, $url, $json) = @_;
         warn "put $url ",dump($json);  
77    
78          if ( ! defined $json->{_rev} ) {          if ( ! defined $json->{_rev} ) {
79                  my $old = eval { $self->get( $url )->{_rev} };                  my $old = eval { $self->get( $url )->{_rev} };
# Line 103  sub audit { Line 102  sub audit {
102          $url =~ s/-\S+//g;          $url =~ s/-\S+//g;
103          $url =~ s/\W+/-/g;          $url =~ s/\W+/-/g;
104    
105          my ( $package, undef, $line, $sub ) = caller(1);          my ( $package, $file, $line, $sub ) = caller(1);
106          ( $package, undef, $line ) = caller(0) if $package eq 'main';          ( $package, undef, $line ) = caller(0) if $package eq 'main';
107    
108            my $t = time();
109    
110          $data->{x_meta} = {          $data->{x_meta} = {
111                  'ident' => [ @_ ],                  'time' => $t,
                 'time' => time(),  
112                  'package' => $package,                  'package' => $package,
113                  'line' => $line,                  'line' => $line,
114                  'sub' => $sub,                  'sub' => $sub,
115          };          };
116            $data->{'ident'} = [ @_ ] if @_;
117    
118            warn 'audit ', dump($data), "at $file +$line\n";
119    
120          $audit->put( "pxelator/$package.$url", $data );          $audit->put( "pxelator/$t.$package.$url", $data );
121  }  }
122    
123  1;  1;

Legend:
Removed from v.206  
changed lines
  Added in v.207

  ViewVC Help
Powered by ViewVC 1.1.26