line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Dispatch::Wx; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
751
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
5
|
1
|
|
|
1
|
|
12
|
use base qw(Log::Dispatch::Output); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
697
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Wx; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
|
|
|
|
|
|
my( $class, %p ) = @_; |
13
|
|
|
|
|
|
|
my $self = bless {}, $class; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$self->_basic_init(%p); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my %level_map = |
21
|
|
|
|
|
|
|
( 0 => 'Wx::LogDebug', |
22
|
|
|
|
|
|
|
1 => 'Wx::LogMessage', |
23
|
|
|
|
|
|
|
2 => 'Wx::LogMessage', |
24
|
|
|
|
|
|
|
3 => 'Wx::LogWarning', |
25
|
|
|
|
|
|
|
4 => 'Wx::LogError', |
26
|
|
|
|
|
|
|
5 => 'Wx::LogError', |
27
|
|
|
|
|
|
|
6 => 'Wx::LogError', |
28
|
|
|
|
|
|
|
7 => 'Wx::LogError', |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub log_message { |
33
|
|
|
|
|
|
|
my( $self, %p ) = @_; |
34
|
|
|
|
|
|
|
my $level = $self->_level_as_number( $p{level} ); |
35
|
|
|
|
|
|
|
my $sub = $level_map{$level}; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
no strict 'refs'; |
38
|
|
|
|
|
|
|
&$sub( '%s', $p{message} ); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |