File Coverage

blib/lib/Mojolicious/Plugin/Log/Access.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 11 11 100.0


line stmt bran cond sub pod time code
1             package Mojolicious::Plugin::Log::Access;
2 2     2   2338 use Mojo::Base 'Mojolicious::Plugin';
  2         4  
  2         16  
3              
4             our $VERSION = 0.023;
5              
6             sub register {
7 1     1 1 34 my ($self, $app) = @_;
8             $app->hook(after_dispatch => sub {
9 4     4   91336 my $c = shift;
10 4         78 $app->log->info(sprintf '%s "%s" %s',
11             $c->tx->remote_address, $c->req->url->to_abs->path, $c->res->code);
12 1         8 });
13             }
14              
15             1;
16             __END__