Amanda-2.6.0

Amanda::Debug


NAME

Amanda::Debug - support for debugging Amanda applications


SYNOPSIS

  use Amanda::Debug qw( :init :logging );
  # (note: dbopen and such are usually handled by 
  #  Amanda::Util::setup_applicaton)
  dbopen("server");
  debug("this is a debug message");

See debug.h for a more in-depth description of the functionality of this module.


API STATUS

Stable


DEBUG LOGGING

Several debug logging messages, each taking a single string, are available:

error - also aborts the program to produce a core dump
critical - exits the program with $error_exit_status
warning
message
info
debug

ALl of the debug logging functions are available via the export tag :logging.


ADVANCED USAGE

Most applications should use the Amanda::Util manpage's setup_application to initialize the debug libraries. The initialization functions available from this module are thus considered ``advanced'', and the reader is advised to consult the C header, debug.h, for details.

Briefly, the functions dbopen and dbrename are used to open a debug file whose pathname includes all of the relevant information. dbclose and dbreopen are used to close that debug file before transferring control to another process.

The variable $erroutput_type can take on any combination of the flags $ERROUTPUT_INTERACTIVE, $ERROUTPUT_SYSLOG and $ERROUTPUT_AMANDALOG. $ERROUTPUT_INTERACTIVE causes messages from error and critical to be sent to stderr. $ERROUTPUT_SYSLOG sends it to syslog, and $ERROUTPUT_AMANDALOG sends it to the current trace log (see the Amanda::Logfile manpage).

$error_exit_status is the exit status with which critical will exit.

All of the initialization functions and variables are available via the export tag :init.

The current debug file's integer file descriptor (not a Perl filehandle) is available from dbfd(). Likewise, dbfn() returns the filename of the current debug file.

debug_dup_stderr_to_debug() redirects, at the file-descriptor level, STDERR into the debug file. This is useful when running external applications which may produce error output.


ABOUT THIS PAGE

This page was automatically generated Mon Nov 17 19:29:37 2008 from the Amanda source tree, and documents the most recent development version of Amanda. For documentation specific to the version of Amanda on your system, use the 'perldoc' command.


Amanda-2.6.0