line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Mini::LoggerFILE; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
78015
|
use strict; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
85
|
|
4
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
66
|
|
5
|
3
|
|
|
3
|
|
11
|
use IO::Handle; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
143
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
14
|
use base 'Log::Mini::LoggerBase'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
990
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
13
|
|
|
13
|
0
|
16271
|
my $self = shift->SUPER::new(@_); |
12
|
13
|
|
|
|
|
41
|
my (%params) = @_; |
13
|
|
|
|
|
|
|
|
14
|
13
|
|
|
|
|
23
|
$self->{file} = $params{file}; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# TODO: Allow logrotate |
17
|
13
|
50
|
|
|
|
510
|
open my $fh, '>>', $params{file} or die $!; |
18
|
13
|
100
|
|
|
|
43
|
if (defined $params{'synced'}) { |
19
|
1
|
|
|
|
|
10
|
$fh->autoflush(1); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
13
|
|
|
|
|
65
|
$self->{fh} = $fh; |
23
|
|
|
|
|
|
|
|
24
|
13
|
|
|
|
|
49
|
return $self; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _print { |
28
|
12
|
|
|
12
|
|
16
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
12
|
|
|
|
|
13
|
my $fh = $self->{fh}; |
31
|
12
|
|
|
|
|
114
|
print $fh @_; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub DESTROY { |
36
|
13
|
|
|
13
|
|
2437
|
close shift->{'fh'}; |
37
|
13
|
|
|
|
|
83
|
return; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
1; |