/[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 240 by dpavlin, Mon Aug 17 00:52:51 2009 UTC revision 485 by dpavlin, Sat Jan 23 19:46:19 2010 UTC
# Line 8  use warnings; Line 8  use warnings;
8  use LWP::UserAgent;  use LWP::UserAgent;
9  use JSON;  use JSON;
10  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
 use Time::HiRes qw/time/;  
11  use Data::Structure::Util qw(unbless);  use Data::Structure::Util qw(unbless);
12  use Scalar::Util qw/blessed/;  use Scalar::Util qw/blessed/;
13  use Storable qw/dclone/;  use Storable qw/dclone/;
# Line 114  sub post { Line 113  sub post {
113    
114  our $audit = __PACKAGE__->new;  our $audit = __PACKAGE__->new;
115    
116  sub audit {  sub _store_audit {
117          my $data = pop @_;          my ( $id, $data ) = @_;
118            $audit->put( "pxelator/$id", $data );
         my $url = join(' ', @_);  
         $url =~ s/\s+-\S+//g;   # remove command line options  
         $url =~ s/\W+/-/g;  
   
         my ( $package, $file, $line, $sub ) = caller(1);  
         ( $package, undef, $line ) = caller(0) if ! $package || $package eq 'main';  
   
         my $time = time();  
         $sub =~ s{^.+::}{}; # stip package name  
   
         $data->{$_} = eval '$' . $_ foreach ( qw/time package line sub/ );  
   
 #       carp 'audit ', dump($data);  
   
         $time = int($time); # reduce granularity  
         $audit->put( "pxelator/$time.$package.$url", $data );  
   
119  }  }
120    
121  1;  1;

Legend:
Removed from v.240  
changed lines
  Added in v.485

  ViewVC Help
Powered by ViewVC 1.1.26