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 | 2062 | use Mojolicious::Plugin -base; | |||
2 | 265 | ||||||
2 | 19 | ||||||
3 | |||||||
4 | our $VERSION = 0.031; | ||||||
5 | |||||||
6 | sub register { | ||||||
7 | 1 | 1 | 1 | 36 | my ($self, $app) = @_; | ||
8 | $app->hook(after_dispatch => sub { | ||||||
9 | 4 | 4 | 35000 | my $c = shift; | |||
10 | 4 | 16 | $app->log->info(sprintf '%s "%s" %s', $c->tx->remote_address, | ||||
11 | $c->req->url->to_abs->path_query, $c->res->code); | ||||||
12 | 1 | 7 | }); | ||||
13 | } | ||||||
14 | |||||||
15 | 1; | ||||||
16 | __END__ |