Perl extension providing logging support for refdb applications
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 \*(L"File\*(R"), 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.
Send bug reports, questions, and comments to the refdb-users mailing list at:
For list information and archives, please visit:
http://lists.sourceforge.net/lists/listinfo/refdb-users
Markus Hoenicka, [email protected]
This module is part of the RefDB package, a reference manager and bibliography tool for markup languages. Please visit http://refdb.sourceforge.net for further information.
Title : new
Usage : $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
Title : num_loglevel
Usage : $level = log->num_loglevel(\*(L"\s-1ALERT\s0\*(R")
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
Title : num_logdest
Usage : $dest = log->num_logdest(\*(L"\s-1SYSLOG\s0\*(R")
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
Title : log_print
Usage : $log->log_print(\*(L"\s-1ERR\s0\*(R", \*(L"could not open file\*(R")
Function: sends a log message to the selected destination
Argument: priority (ALERT|CRIT|ERR|WARNING|NOTICE|INFO|DEBUG)
message
Title : close
Usage : $log->close()
Function: closes the log destination