/[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 258 by dpavlin, Tue Aug 18 21:53:19 2009 UTC revision 483 by dpavlin, Sat Jan 23 18:58:18 2010 UTC
# Line 114  sub post { Line 114  sub post {
114    
115  our $audit = __PACKAGE__->new;  our $audit = __PACKAGE__->new;
116    
117  sub audit {  sub _store_audit {
118          my $data = pop @_;          my ( $id, $data ) = @_;
119            $audit->put( "pxelator/$id", $data );
         my $url = join(' ', @_);  
         $url =~ s/\s+-\S+//g;   # remove command line options  
         $url =~ s/\W+/-/g;  
   
         my $time = $data->{time} = time();  
   
         my @caller_name = ( qw/package file line sub/ );  
         my @caller = caller(0);  
         $caller[3] = (caller(1))[3];  
         $caller[3] =~ s{^.+::}{}; # stip package name from sub  
         $data->{ $caller_name[$_] } = $caller[$_] foreach ( 0 .. $#caller_name );  
   
         if ( $ENV{DEBUG} ) {  
   
                 my $caller;  
                 my $depth = 0;  
                 while ( my @c = caller($depth) ) {  
                         push @$caller, [ @c ];  
                         $depth++;  
                 }  
   
                 $data->{caller} = $caller;  
   
         }  
   
 #       carp 'audit ', dump($data);  
   
         $time = int($time); # reduce granularity for url  
         my $package = $caller[0];  
         $audit->put( "pxelator/$time.$package.$url", $data );  
   
120  }  }
121    
122  1;  1;

Legend:
Removed from v.258  
changed lines
  Added in v.483

  ViewVC Help
Powered by ViewVC 1.1.26