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