GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  LOG::HANDLER::OUTPUT::FORWARD (3)

.ds Aq ’

NAME

Log::Handler::Output::Forward - Forward messages to routines.

CONTENTS

SYNOPSIS



    use Log::Handler::Output::Forward;

    my $forwarder = Log::Handler::Output::Forward->new(
        forward_to => sub { },
        arguments  => [ "foo" ],
    );

    $forwarder->log(message => $message);



DESCRIPTION

This output module makes it possible to forward messages to sub routines.

METHODS

new()

Call new() to create a new Log::Handler::Output::Forward object.

The following options are possible:
<B>forward_toB> This option excepts a code reference.

Please note that the message is forwarded as a hash reference. If you change it then this would have an effect to all outputs.

<B>argumentsB> With this option you can define arguments that will be passed to the sub routine.

In the following example the arguments would be passed as a array to Class::method().



    my $forwarder = Log::Handler::Output::Forward->new(
        forward_to => \&Class::method,
        arguments  => [ $self, "foo" ],
    );



This would call intern:



    Class::method(@arguments, $message);



If this option is not set then the message will be passed as first argument.

log()

Call log() if you want to forward messages to the subroutines.

Example:



    $forwarder->log("this message will be forwarded to all sub routines");



validate()

Validate a configuration.

reload()

Reload with a new configuration.

errstr()

This function returns the last error message.

FORWARDED MESSAGE

Note that the message will be forwarded as a hash reference.

If you make changes to the reference it affects all other outputs.

The hash key message contains the message.

PREREQUISITES



    Carp
    Params::Validate



EXPORTS

No exports.

REPORT BUGS

Please report all bugs to <jschulz.cpan(at)bloonix.de>.

If you send me a mail then add Log::Handler into the subject.

AUTHOR

Jonny Schulz <jschulz.cpan(at)bloonix.de>.

COPYRIGHT

Copyright (C) 2007-2009 by Jonny Schulz. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 LOG::HANDLER::OUTPUT::FORWARD (3) 2013-11-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.