line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MojoX::Log::Declare; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1800
|
use Mojo::Base -base; |
|
1
|
|
|
|
|
11662
|
|
|
1
|
|
|
|
|
12
|
|
4
|
1
|
|
|
1
|
|
1302
|
use Log::Declare; |
|
1
|
|
|
|
|
62451
|
|
|
1
|
|
|
|
|
6
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
442
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
9
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
51
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
{ |
12
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
13
|
1
|
|
|
1
|
|
4
|
no warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
254
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
for my $level (@Log::Declare::level_priority) { |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
*{ __PACKAGE__ . "::$level" } = sub { |
18
|
0
|
|
|
0
|
|
|
my $self = shift; |
19
|
0
|
|
|
|
|
|
Log::Declare->log( $level, ['MOJO'], @_ ); |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
*{ __PACKAGE__ . "::log" } = sub { |
24
|
0
|
|
|
0
|
|
|
my $self = shift; |
25
|
0
|
|
|
|
|
|
Log::Declare->log( 'info', ['MOJO'], @_ ); |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
MojoX::Log::Declare - Integrate Log::Declare with Mojolicious |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 SYNOPSIS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
use Mojo::Base 'Mojolicious'; |
38
|
|
|
|
|
|
|
use MojoX::Log::Declare; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub startup { |
41
|
|
|
|
|
|
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$self->log( MojoX::Log::Declare->new() ); |
44
|
|
|
|
|
|
|
# ... |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |