---
name: "RefDB::Log"
section: "3pm"
platform: "linux"
package: "librefdb-perlmod-perl"
version: "1.2-2"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/RefDB::Log"
---

# RefDB::Log(3pm)

Perl extension providing logging support for RefDB applications

## NAME

RefDB::Log - Perl extension providing logging support for RefDB applications

## 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:

refdb-users@lists.sourceforge.net

For list information and archives, please visit:

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

## AUTHOR

Markus Hoenicka, markus@mhoenicka.de

## SEE ALSO

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("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\_logdest

Usage   : `$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\_print

Usage   : `$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   : close

Usage   : `$log`-\>*close()*

Function: closes the log destination
