home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / SimpleLayout.pm < prev    next >
Encoding:
Perl POD Document  |  2003-01-20  |  1.5 KB  |  69 lines

  1. ##################################################
  2. package Log::Log4perl::Layout::SimpleLayout;
  3. ##################################################
  4. # as documented in
  5. # http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/SimpleLayout.html
  6. ##################################################
  7.  
  8. use 5.006;
  9. use strict;
  10. use warnings;
  11. use Log::Log4perl::Level;
  12.  
  13. no strict qw(refs);
  14. use base qw(Log::Log4perl::Layout);
  15.  
  16. ##################################################
  17. sub 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. ##################################################
  34. sub render {
  35. ##################################################
  36.     my($self, $message, $category, $priority, $caller_level) = @_;
  37.  
  38.     return "$priority - $message\n";
  39. }
  40.  
  41. 1;
  42.  
  43. __END__
  44.  
  45. =head1 NAME
  46.  
  47. Log::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.  
  56. This class implements the C<log4j> simple layout format -- it basically 
  57. just prints the message priority and the message, that's all.
  58. Check 
  59. http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/SimpleLayout.html
  60. for details.
  61.  
  62. =head1 SEE ALSO
  63.  
  64. =head1 AUTHOR
  65.  
  66. Kevin Goess, <cpan@goess.org>
  67.  
  68. =cut
  69.