SYNOPSIS
use RefDB::Log;
my $log = RefDB::Log::->new("FILE", "INFO", "/var/log/testdata.out", "myapp.pl");
## this message should appear
$log->log_print("ERR", "first test message");
## this message should not appear
$log->log_print("DEBUG", "second test message");
$log->close();
DESCRIPTION
RefDB::Log defines a class that povides logging support to RefDB applications. After creating a Log object with appropriate settings for log level, log destination, the path to a log file (if logdest is ``File''), and a string that is prepended to log messages, calls to the log_print() function will send a log message to the appropriate destination if the log level permits this.
FEEDBACK
Send bug reports, questions, and comments to the refdb-users mailing list at:For list information and archives, please visit:
AUTHOR
Markus Hoenicka, [email protected]new
Title : newUsage : $pm = new RefDB::Log();
Function: Creates a new Log object
Argument: log destination (0|1|2 or STDERR|SYSLOG|FILE)
log level (0-7 or ALERT|CRIT|ERR|WARNING|NOTICE|INFO|DEBUG)
log file (path to custom log file if destination is 2)
prefix for log messages (denotes where the log is from)
Return : a Log object
num_loglevel
Title : num_loglevelUsage : $level = log->num_loglevel(``ALERT'')
Function: Calculates the numeric log level from either a numeric or
alphanumeric value
Argument: log level (0-7 or ALERT|CRIT|ERR|WARNING|NOTICE|INFO|DEBUG)
Return : numeric log level
num_logdest
Title : num_logdestUsage : $dest = log->num_logdest(``SYSLOG'')
Function: Calculates the numeric log destination from either a numeric or
alphanumeric value
Argument: log dest (0-2 or STDERR|SYSLOG|FILE)
Return : numeric log dest
log_print
Title : log_printUsage : $log->log_print(``ERR'', ``could not open file'')
Function: sends a log message to the selected destination
Argument: priority (ALERT|CRIT|ERR|WARNING|NOTICE|INFO|DEBUG)
message
close
Title : closeUsage : $log->close()
Function: closes the log destination