[Bps-public-commit] r16939 - in Path-Dispatcher/trunk: lib/Path/Dispatcher

sartak at bestpractical.com sartak at bestpractical.com
Wed Nov 19 16:59:10 EST 2008


Author: sartak
Date: Wed Nov 19 16:59:09 2008
New Revision: 16939

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm

Log:
 r75834 at onn:  sartak | 2008-11-19 16:51:27 -0500
 Include "readable attributes" in the trace (regex, tokens, etc)


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm	Wed Nov 19 16:59:09 2008
@@ -69,6 +69,8 @@
     $self->block->(@_);
 }
 
+sub readable_attributes { }
+
 sub trace {
     my $self  = shift;
     my %args  = @_;
@@ -76,9 +78,15 @@
     my $match = $args{match};
     my $path  = $match ? $match->path->path : $args{path}->path;
 
+    # name
     my $trace = "$self";
     $trace .= " (" . $self->name . ")" if $self->has_name;
 
+    # attributes such as tokens or regex
+    my $attr = $self->readable_attributes;
+    $trace .= " $attr" if defined($attr) && length($attr);
+
+    # what just happened
     if ($args{running}) {
         $trace .= " running codeblock with path ($path)";
     }



More information about the Bps-public-commit mailing list