3.3.9.svn.6881

Amanda modules list
List of All Modules
All Amanda Releases

Amanda::Message


NAME

Amanda::Message - Amanda object use to return a message

Most API use or should be converted to use it.


SYNOPSIS

   # create a message
   my $msg = Amanda::Message->new(source_filename => __FILE__,
                                  source_line => __LINE__,
                                  severity    => $CRITICAL;
                                  code        => 1,
                                  message     => "This is a message",
                                  label       => $label);
   print $msg->message();


Message Objects

'source_filename' and 'source_line' are use for debuging to find where the message was generated.

The 'severity' of the message, the default is G_CRITICAL, it must be one of these predefined constants: ERROR CRITICAL WARNING MESSAGE INFO DEBUG

The 'code' must be unique, it identify the message (0 to 3 are used for message not handled by Amanda::Message): 0 GOOD message 1 ERROR with a message 2 ERROR without a message 3 Amanda::Changer::Error #You should never create it 1000000 Amanda::Label message 1100000 Amanda::Changer::Message 1200000 Amanda::Recovery::Message 1300000 Amanda::Curinfo::Message 1400000 Amanda::Disklist::Message 1500000 Amanda::Config::Message 1600000 Amanda::Tapelist::Message 1700000 Amanda::Device::Message 1800000 Amanda::Status::Message 1900000 Amanda::Report::Message 2000000 Amanda::Amdump::Message 2100000 Amanda::Cmdfile::Message 2200000 Amanda::Amflush::Message 2400000 Amanda::Index::Message 2500000 Amanda::Amvault::Message 2600000 Amanda::DB::Message 2700000 Amanda::CheckDump::Message 2800000 amcheck 2900000 senddiscover 3000000 Amanda::Amvmware::Message 3100000 Amanda::Service::Message 3200000 amanda-extensions

general keys: code => source_filename => source_line => message => 'default message' #optional

each code can have it's own set of keys: filename => errno => label => config => barcode => storage => pool => meta => dev_error =>

'message' is required only for code 0 and 1.

You must add all required fields to be able to rebuild the message string, this can include the label, config, barcode, errno, errorstr or any other fields.


Using as subclass

Each Amanda perl module should have an Amanda::Message subclass to describe all messages from the module.

eg. class Amanda::Label::Message is used by class Amanda::Label.

The subclass (Amanda::Label::Message) must overload the local_message method to return a string version of the message.


ABOUT THIS PAGE

This page was automatically generated Tue Oct 4 19:45:36 2016 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.


3.3.9.svn.6881