Skip to content

Instantly share code, notes, and snippets.

/debug.diff Secret

Created February 10, 2016 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/831e983fce089a5d23d4 to your computer and use it in GitHub Desktop.
Save anonymous/831e983fce089a5d23d4 to your computer and use it in GitHub Desktop.
diff --git a/lib/Mojolicious.pm b/lib/Mojolicious.pm
index 4ad34e6..c944c55 100644
--- a/lib/Mojolicious.pm
+++ b/lib/Mojolicious.pm
@@ -97,11 +97,12 @@ sub dispatch {
# Start timer (ignore static files)
my $stash = $c->stash;
- unless ($stash->{'mojo.static'} || $stash->{'mojo.started'}) {
+ my $log = $self->log;
+ if ($log->is_debug && !$stash->{'mojo.static'} && !$stash->{'mojo.started'}) {
my $req = $c->req;
my $method = $req->method;
my $path = $req->url->path->to_abs_string;
- $self->log->debug(qq{$method "$path"});
+ $log->debug(qq{$method "$path"});
$stash->{'mojo.started'} = [Time::HiRes::gettimeofday];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment