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 \*(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.

FEEDBACK

Send bug reports, questions, and comments to the refdb-users mailing list at:

[email protected]

For list information and archives, please visit:

http://lists.sourceforge.net/lists/listinfo/refdb-users

AUTHOR

Markus Hoenicka, [email protected]

RELATED TO RefDB::Log…

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.

new

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

num_loglevel

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

num_logdest

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

log_print

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

close

Title : close

Usage : $log->close()

Function: closes the log destination