File Coverage

blib/lib/Log/Log4perl/Layout/SimpleLayout.pm
Criterion Covered Total %
statement 24 24 100.0
branch n/a
condition 1 3 33.3
subroutine 8 8 100.0
pod 0 2 0.0
total 33 37 89.1


line stmt bran cond sub pod time code
1             ##################################################
2             ##################################################
3             # as documented in
4             # http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/SimpleLayout.html
5             ##################################################
6              
7             use 5.006;
8 70     70   1192 use strict;
  70         214  
9 70     70   328 use warnings;
  70         126  
  70         1360  
10 70     70   1988 use Log::Log4perl::Level;
  70         1587  
  70         1866  
11 70     70   394  
  70         125  
  70         361  
12             no strict qw(refs);
13 70     70   383 use base qw(Log::Log4perl::Layout);
  70         160  
  70         2116  
14 70     70   383  
  70         159  
  70         15460  
15             ##################################################
16             ##################################################
17             my $class = shift;
18             $class = ref ($class) || $class;
19 99     99 0 196  
20 99   33     378 my $self = {
21             format => undef,
22 99         428 info_needed => {},
23             stack => [],
24             };
25              
26             bless $self, $class;
27              
28 99         206 return $self;
29             }
30 99         355  
31             ##################################################
32             ##################################################
33             my($self, $message, $category, $priority, $caller_level) = @_;
34              
35             return "$priority - $message\n";
36 188     188 0 468 }
37              
38 188         555 1;
39              
40              
41             =encoding utf8
42              
43             =head1 NAME
44              
45             Log::Log4perl::Layout::SimpleLayout - Simple Layout
46              
47             =head1 SYNOPSIS
48              
49             use Log::Log4perl::Layout::SimpleLayout;
50             my $layout = Log::Log4perl::Layout::SimpleLayout->new();
51              
52             =head1 DESCRIPTION
53              
54             This class implements the C<log4j> simple layout format -- it basically
55             just prints the message priority and the message, that's all.
56             Check
57             http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/SimpleLayout.html
58             for details.
59              
60             =head1 SEE ALSO
61              
62             =head1 LICENSE
63              
64             Copyright 2002-2013 by Mike Schilli E<lt>m@perlmeister.comE<gt>
65             and Kevin Goess E<lt>cpan@goess.orgE<gt>.
66              
67             This library is free software; you can redistribute it and/or modify
68             it under the same terms as Perl itself.
69              
70             =head1 AUTHOR
71              
72             Please contribute patches to the project on Github:
73              
74             http://github.com/mschilli/log4perl
75              
76             Send bug reports or requests for enhancements to the authors via our
77              
78             MAILING LIST (questions, bug reports, suggestions/patches):
79             log4perl-devel@lists.sourceforge.net
80              
81             Authors (please contact them via the list above, not directly):
82             Mike Schilli <m@perlmeister.com>,
83             Kevin Goess <cpan@goess.org>
84              
85             Contributors (in alphabetical order):
86             Ateeq Altaf, Cory Bennett, Jens Berthold, Jeremy Bopp, Hutton
87             Davidson, Chris R. Donnelly, Matisse Enzer, Hugh Esco, Anthony
88             Foiani, James FitzGibbon, Carl Franks, Dennis Gregorovic, Andy
89             Grundman, Paul Harrington, Alexander Hartmaier David Hull,
90             Robert Jacobson, Jason Kohles, Jeff Macdonald, Markus Peter,
91             Brett Rann, Peter Rabbitson, Erik Selberg, Aaron Straup Cope,
92             Lars Thegler, David Viner, Mac Yang.
93