server_base sucks
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Log.pm
CommitLineData
fc7ec1d9 1package Catalyst::Log;
2
3use strict;
4use base 'Class::Accessor::Fast';
5
6=head1 NAME
7
8Catalyst::Log - Catalyst Log Class
9
10=head1 SYNOPSIS
11
12See L<Catalyst>.
13
14=head1 DESCRIPTION
15
16Simple logging functionality for Catalyst.
17
18=head2 METHODS
19
20=head3 debug
21
22Log debug informations.
23
24=cut
25
26sub debug { _format( 'debug', $_[1] ) }
27
28=head3 error
29
30Log error informations.
31
32=cut
33
34sub error { _format( 'error', $_[1] ) }
35
36=head3 info
37
38Log informations.
39
40=cut
41
42sub info { _format( 'info', $_[1] ) }
43
44=head3 warn
45
46Log warnings.
47
48=cut
49
50sub warn { _format( 'warn', $_[1] ) }
51
52sub _format {
53 print STDERR '[' . localtime(time) . "] [catalyst] [$_[0]] $_[1]\n";
54}
55
56=head1 SEE ALSO
57
58L<Catalyst>.
59
60=head1 AUTHOR
61
62Sebastian Riedel, C<sri@cpan.org>
63
64=head1 COPYRIGHT
65
66This program is free software, you can redistribute it and/or modify it under
67the same terms as Perl itself.
68
69=cut
70
711;