/[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 221 by dpavlin, Sat Aug 15 14:21:55 2009 UTC revision 258 by dpavlin, Tue Aug 18 21:53:19 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            my @caller = caller(0);
128            $caller[3] = (caller(1))[3];
129            $caller[3] =~ s{^.+::}{}; # stip package name from sub
130            $data->{ $caller_name[$_] } = $caller[$_] foreach ( 0 .. $#caller_name );
131    
132            if ( $ENV{DEBUG} ) {
133    
134                    my $caller;
135                    my $depth = 0;
136                    while ( my @c = caller($depth) ) {
137                            push @$caller, [ @c ];
138                            $depth++;
139                    }
140    
141          $data->{$_} = eval '$' . $_ foreach ( qw/time package line sub/ );                  $data->{caller} = $caller;
142    
143            }
144    
145  #       carp 'audit ', dump($data);  #       carp 'audit ', dump($data);
146    
147          $time = int($time); # reduce granularity          $time = int($time); # reduce granularity for url
148            my $package = $caller[0];
149          $audit->put( "pxelator/$time.$package.$url", $data );          $audit->put( "pxelator/$time.$package.$url", $data );
150    
151  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26