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