Apache2::LogF - Format Apache 2 log messages like sprintf
Version 0.01
use Apache2::RequestRec (); use Apache2::LogF (); use Apache2::Const -compile => qw(OK); sub handler { my $r = shift; my $log = $r->log; # ... $log->debugf('%d is a curious value', $curious_value); $log->infof('%s is really fantastic.', $interesting_stuff); $log->noticef('current user is %s', $r->user); $log->warnf('%s happened %d times', $thing, $times); $log->errorf('bzzzt. you already did this %d times.', $times); $log->critf('ah crap now you went and did %s.', $bad_thing); $log->alertf('uhoh the process is taking %0.2f megs of ram.', $megs); $log->emergf('okay now we are on fire over %s.', $where); # ... return Apache2::Const::OK; }
take your favourite Apache2::Log convenience method (emerg, alert, crit, error, warn, notice, info, debug) and add an 'f' to the end. now treat it like sprintf. fan-tastic.
dorian taylor, <dorian@cpan.org>
<dorian@cpan.org>
Please report any bugs or feature requests to bug-apache-logf@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Apache-LogF. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-apache-logf@rt.cpan.org
Copyright 2005 dorian taylor, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Apache::LogF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache::LogF
CPAN shell
perl -MCPAN -e shell install Apache::LogF
For more information on module installation, please visit the detailed CPAN module installation guide.