The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Fault::Delegate::Stderr - Stderr print logger delegate

SYNOPSIS

 use Fault::Delegate::Stderr;
 $self = Fault::Delegate::Stderr->new;
 $okay = $self->log ($msg);

Inheritance

 UNIVERSAL
   Fault::Delegate
     Fault::Delegate::Stderr

Description

This is a Logger delegate that writes all the log messages to stderr. It is Logger's default delegate if no other is given. It is also a pretty good one to start with when you are trying to understand how this system works.

It satisfies the absolute minimum requirements of the Fault::Delegate logger delegate protocol.

Examples

 use Fault::Delegate::Stderr;
 use Fault::Logger;
 use Fault::Msg;

 my $msg       = Fault::Msg                   ("Arf!");
 my $baz       = Fault::Delegate::Stderr->new ("/tmp/mylogfile");
 my $waslogged = $baz->log                    ($msg);

                 Fault::Logger->new           ($baz);
 my $waslogged = Fault::Logger->log           ("Bow! Wow!");

Instance Variables

None.

Class Methods

$delegate = Fault::Delegate::Stderr->new

Create a logger delegate object that prints log messages to stderr. Prints a warning message and returns undef on failure.

Logger Protocol Instance Methods

$okay = $self->log ($msg)

Print a time-stamped message to stderr using information taken from Fault::Msg object $msg in the format:

      $date $time UTC> $process: $type($priority): $msg\n

for example:

      20021207 223010 UTC> MyProcess: NOTE(notice): Nothing happened today.\n

Return true if the message was printed.

Private Class Methods

None.

Private Instance Methods

$bool = $self->_write ($msg)

Impliments the above override to the internal family protocol utilized by the Fault:Delegate log and test methods.

Errors and Warnings

Local warning messages are issued if the sys logger cannot be reached or has any problems whatever.

SEE ALSO

Fault::Logger, Fault::Delegate, Fault::Msg

AUTHOR

Dale Amon <amon@vnl.com>

3 POD Errors

The following errors were encountered while parsing the POD:

Around line 98:

=back doesn't take any parameters, but you said =back 4

Around line 117:

=back doesn't take any parameters, but you said =back 4

Around line 132:

=back doesn't take any parameters, but you said =back 4