4 use base 'Class::Accessor::Fast';
7 $Data::Dumper::Terse = 1;
11 Catalyst::Log - Catalyst Log Class
16 $log->debug(@message);
17 $log->error(@message);
25 This module provides the default, simple logging functionality for Catalyst.
26 If you want something different set C<$c->log> in your application module, e.g.:
28 $c->log( MyLogger->new );
30 Your logging object is expected to provide the interface described here.
37 =item $log->debug(@message)
39 Logs a debugging message.
43 sub debug { shift->_format( 'debug', @_ ) }
45 sub dump { shift->_format( 'dump', Dumper( $_[1] ) ) }
47 =item $log->error(@message)
49 Logs an error message.
53 sub error { shift->_format( 'error', @_ ) }
55 =item $log->info(@message)
57 Logs an informational message.
61 sub info { shift->_format( 'info', @_ ) }
63 =item $log->warn(@message)
65 Logs a warning message.
69 sub warn { shift->_format( 'warn', @_ ) }
74 my $time = localtime(time);
75 my $message = join( "\n", @_ );
76 printf( STDERR "[%s] [catalyst] [%s] %s\n", $time, $level, $message );
87 Sebastian Riedel, C<sri@cpan.org>
91 This program is free software, you can redistribute it and/or modify it under
92 the same terms as Perl itself.