File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed
lib/Log/Log4perl/Appender Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 2
2
Revision history for Log::Log4perl
3
3
##################################################
4
4
1.32 (not yet released)
5
- * [RT 62674] Fixed call to deprecated form of UNIVERSAL::can (Karen
5
+ * (ms) [RT 62674] Fixed call to deprecated form of UNIVERSAL::can (Karen
6
6
Etheridge).
7
+ * (ms) [RT 62896] Log::Log4perl::Appender::ScreenColoredLevels now
8
+ inherits from Log::Log4perl::Appender::Screen and therefore
9
+ supports the utf8 flag.
7
10
8
11
1.31 (2010/10/27)
9
12
* (ms) Fixed the number of skipped tests for Windows for previous fix
Original file line number Diff line number Diff line change 1
1
# #################################################
2
2
package Log::Log4perl::Appender::ScreenColoredLevels ;
3
3
# #################################################
4
- our @ISA = qw( Log::Log4perl::Appender) ;
4
+ use Log::Log4perl::Appender::Screen;
5
+ our @ISA = qw( Log::Log4perl::Appender::Screen) ;
5
6
6
7
use warnings;
7
8
use strict;
@@ -12,14 +13,18 @@ use Log::Log4perl::Level;
12
13
# #################################################
13
14
sub new {
14
15
# #################################################
15
- my ($class , @options ) = @_ ;
16
-
17
- my $self = {
18
- name => " unknown name" ,
19
- stderr => 1,
20
- color => {},
21
- @options ,
22
- };
16
+ my ($class , %options ) = @_ ;
17
+
18
+ my %specific_options = ( color => {} );
19
+
20
+ for my $option ( keys %specific_options ) {
21
+ $specific_options { $option } = delete $options { $option } if
22
+ exists $options { $option };
23
+ }
24
+
25
+ my $self = $class -> SUPER::new( %options );
26
+ @$self { keys %specific_options } = values %specific_options ;
27
+ bless $self , __PACKAGE__ ; # rebless
23
28
24
29
# also accept lower/mixed case levels in config
25
30
for my $level ( keys %{ $self -> {color } } ) {
You can’t perform that action at this time.
0 commit comments