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 =item $log->error(@message)
47 Logs an error message.
51 sub error { shift->_format( 'error', @_ ) }
53 =item $log->info(@message)
55 Logs an informational message.
59 sub info { shift->_format( 'info', @_ ) }
61 =item $log->warn(@message)
63 Logs a warning message.
67 sub warn { shift->_format( 'warn', @_ ) }
72 my $time = localtime(time);
73 my $message = join( "\n", @_ );
74 printf( STDERR "[%s] [catalyst] [%s] %s\n", $time, $level, $message );
79 =head1 DEPRECATED METHODS
83 =item $log->dump($reference)
85 Logs a Data::Dumper of reference.
89 sub dump { shift->_format( 'dump', Dumper( $_[0] ) ) }
99 Sebastian Riedel, C<sri@cpan.org>
103 This program is free software, you can redistribute it and/or modify it under
104 the same terms as Perl itself.