/[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 256 by dpavlin, Tue Aug 18 21:30:55 2009 UTC
# Line 121  sub audit { Line 121  sub audit {
121          $url =~ s/\s+-\S+//g;   # remove command line options          $url =~ s/\s+-\S+//g;   # remove command line options
122          $url =~ s/\W+/-/g;          $url =~ s/\W+/-/g;
123    
124          my ( $package, $file, $line, $sub ) = caller(1);          my $time = $data->{time} = time();
         ( $package, undef, $line ) = caller(0) if ! $package || $package eq 'main';  
125    
126          my $time = time();          my @caller_name = ( qw/package file line sub/ );
127          $sub =~ s{^.+::}{}; # stip package name          my @caller = caller(0);
128            $caller[3] =~ s{^.+::}{}; # stip package name from sub
129            $data->{ $caller_name[$_] } = $caller[$_] foreach ( 0 .. $#caller_name );
130    
131            my $caller;
132            my $depth = 0;
133            while ( my @c = caller($depth) ) {
134                    push @$caller, [ @c ];
135                    $depth++;
136            }
137    
138          $data->{$_} = eval '$' . $_ foreach ( qw/time package line sub/ );          $data->{caller} = $caller;
139    
140  #       carp 'audit ', dump($data);  #       carp 'audit ', dump($data);
141    
142          $time = int($time); # reduce granularity          $time = int($time); # reduce granularity for url
143            my $package = $caller[0];
144          $audit->put( "pxelator/$time.$package.$url", $data );          $audit->put( "pxelator/$time.$package.$url", $data );
145    
146  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26