NAME

Log::Fine::Formatter - Log message formatting and sanitization

SYNOPSIS

Provides a formatting facility for log messages

use Log::Fine::Handle;
use Log::Fine::Formatter;

my $handle    = Log::Fine::Handle::Console->new();
my $formatter = Log::Fine::Formatter::Detailed->new();

# by default, the handle will set its formatter to
# Log::Fine::Formatter::Basic.  If that's not what you want, set
# it to preference.
$handle->setFormatter($formatter);

# set the time-stamp to "YYYY-MM-DD HH:MM:SS"
$formatter->setTimestamp("%Y-%m-%d %H:%M:%S");

DESCRIPTION

Base ancestral class for all formatters. All customized formatters must inherit from this class. The formatter class allows developers to adjust the time-stamp in a log message to a customizable strftime-compatible string without the tedious mucking about writing a formatter sub-class. By default, the time-stamp format is "%c". See "setTimestamp($format)" and the strftime man page for further details.

METHODS

getTimestamp()

Returns the current strftime(3)-compatible format string for timestamped log messages

format($lvl, $msg, $skip)

Returns the formatted message. Must be sub-classed!

setTimestamp($format)

Sets the time-stamp format to the given strftime(3)-compatible string.

SEE ALSO

perl, strftime, Log::Fine

AUTHOR

Christopher M. Fuhrman, <cfuhrman at panix.com>

BUGS

Please report any bugs or feature requests to bug-log-fine-record at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Log-Fine. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Log::Fine

You can also look for information at:

REVISION INFORMATION

$Id: Formatter.pm 76 2008-06-06 16:36:28Z cfuhrman $

COPYRIGHT & LICENSE

Copyright (c) 2008 Christopher M. Fuhrman, All rights reserved.

This program is free software licensed under the...

The BSD License

The full text of the license can be found in the LICENSE file included with this module.