The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Apache2::LogF - Format Apache 2 log messages like sprintf

VERSION

Version 0.01

SYNOPSIS

    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;
    }

METHODS

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.

AUTHOR

dorian taylor, <dorian@cpan.org>

BUGS

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.

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

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.