line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Log::More; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
34195
|
use Mojo::Base 'Mojo::Log'; |
|
2
|
|
|
|
|
14682
|
|
|
2
|
|
|
|
|
17
|
|
4
|
2
|
|
|
2
|
|
108554
|
use Time::Piece; |
|
2
|
|
|
|
|
16826
|
|
|
2
|
|
|
|
|
12
|
|
5
|
2
|
|
|
2
|
|
167
|
use File::Spec; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
801
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.02'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Increment this if you are using a wrapper |
10
|
|
|
|
|
|
|
our $caller_depth = 0; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has format => sub { \&_format }; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
1
|
1609
|
sub debug { shift->emit('message', 'debug', @_, [caller($caller_depth)]) } |
15
|
1
|
|
|
1
|
1
|
743
|
sub info { shift->emit('message', 'info', @_, [caller($caller_depth)]) } |
16
|
1
|
|
|
1
|
1
|
451
|
sub warn { shift->emit('message', 'warn', @_, [caller($caller_depth)]) } |
17
|
1
|
|
|
1
|
1
|
450
|
sub error { shift->emit('message', 'error', @_, [caller($caller_depth)]) } |
18
|
1
|
|
|
1
|
1
|
480
|
sub fatal { shift->emit('message', 'fatal', @_, [caller($caller_depth)]) } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _format { |
21
|
5
|
|
|
5
|
|
374
|
my $caller = pop; |
22
|
5
|
|
|
|
|
55
|
my $filename = (File::Spec->splitpath($caller->[1]))[2]; |
23
|
|
|
|
|
|
|
|
24
|
5
|
|
|
|
|
19
|
sprintf "%s %s:%i %s> %s", localtime(shift)->datetime, $filename, |
25
|
|
|
|
|
|
|
$caller->[2], uc(shift), join("\n", @_, ''); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |