NAME
Log::SimpleLog::CaptureLog
SYNOPSYS
my $l = new Log::SimpleLog::CaptureLog (
$standard_log ,
$std_out_log , # Optional
$std_err_log , # Optional
);
$l->log_message ( 'Standard log output' );
print STDOUT 'STDOUT log output';
print STDERR 'STDERR log output';
DESCRIPTION
This Perl module class is intended to be a very simple and light-weight logging device with the intent of capturing all the standard out and error messages that are thrown either by an application or by the Perl interpreter its self.
There are methods listed in the documentation that will allow for the changing of any of these rules. For instance, if standard logging with STDERR logging is to be captured, but STDOUT should not, there are methods provided to do so.
CONSTRUCTOR
The constructor is passed a minimum of one and a maximum of three of the following arguments, which will provide the object with the location of the log file of which to pipe specific output to.
The following parameters are intended for use:
- core_filepath
-
The core file path for the custom log messages.
Refer to the set_corefilepath method description
- ex_filepath
-
This parameter is optional.
The location of the STDOUT file path.
Refer to the set_exfilepath method description.
- exc_filepath
-
This parameter is optional.
The location of the STDERR file path.
Refer to the set_excfilepath method description.
METHODS
log_message
The standard input for log entries.
By default, the input message will be formatted into the specified format within the parameters of the object.
The output of this data will be to the location of the core_filepath location
head1 set_buffer_limit
The log it's self will be stored into memory until the 'buffer limit' has been breached. The default buffer limit is 1024, which implies that there will have to be 1024 log lines until the buffer is flushed to the output file.
This method will allow you to adjust this buffer limit in order to utilize less memory than the default setting.
Upon destruction of the object, the log will be flushed, no matter the size of the buffer at the time when the object is removed from the heap.
get_buffer_limit
Will return the current buffer limit as set by the set_buffer_limit method, or by the instantiation/construction of the object (1024)
set_core_filepath
Will set the location of the file of which the custom log messages will be written to.
If no other arguments or set_*_filepath methods are called, this file will also be the location of the STDOUT and STDERR output unless otherwise directed.
set_exfilepath
Will set the location of the STDOUT file path.
By setting this option, the 'core filepath' will only contain the custom log messages sent to the logger.
If no other set_*_filepath method is called, then both STDOUT and STDERR will be streamed to this log
set_excfilepath
Similar to the other two set_*_filepath methods, this method, when used, will set the STDERR file location.
If no other set_*_filepath methods are called, then both STDOUT and STDERR will be streamed to this log.
open_stdout
Will turn off the capturing of the STDOUT stream
open_stderr
Will turn off the capturing of the STDERR stream
AUTHOR
Trevor Hall <hallta@gmail.com>
DEPENDENCIES
Log::SimpleLog IO::Capture::Stdout IO::Capture::Stderr POSIX
COPYRIGHT
Copyright (c) 2005 Trevor Hall. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 234:
You forgot a '=back' before '=head1'