Skip to content
Browse files

More helpful core log message when trying to match routes.

Include the method, and the pattern the compiled regex was generated from.
  • Loading branch information...
1 parent 56acb38 commit 5fe0152cb70294229c1ea06c9c10c5d0856ef696 @bigpresh bigpresh committed
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/Dancer/Route.pm
View
9 lib/Dancer/Route.pm
@@ -81,10 +81,11 @@ sub match {
my $path = $request->path_info;
my %params;
- Dancer::Logger::core("trying to match `$path' "
- . "against /"
- . $self->{_compiled_regexp}
- . "/");
+ Dancer::Logger::core(
+ sprintf "Trying to match '%s %s' against /%s/ (generated from '%s')",
+ $request->method, $path, $self->{_compiled_regexp}, $self->pattern
+ );
+
my @values = $path =~ $self->{_compiled_regexp};

0 comments on commit 5fe0152

Please sign in to comment.
Something went wrong with that request. Please try again.