Jifty::Plugin::TestServerWarnings::Appender - Log appender


Jifty documentation Contained in the Jifty distribution.

Index


Code Index:

NAME

Top

Jifty::Plugin::TestServerWarnings::Appender - Log appender

DESCRIPTION

Top

Log::Log4perl::Appender which stores warnings in memory, for later downloading by the test client.

METHODS

Top

new

Creates a new appender; takes no arguments.

log

Appends the message to Jifty::Plugin::TestServerWarnings' internal storage.


Jifty documentation Contained in the Jifty distribution.
package Jifty::Plugin::TestServerWarnings::Appender;
use strict;
use warnings;
use base qw/Log::Log4perl::Appender/;

sub new {
    my $class = shift;
    return bless {@_}, $class;
}

sub log {
    my $self = shift;
    my $plugin = Jifty->find_plugin("Jifty::Plugin::TestServerWarnings");
    my $message = $_[0]{message};
    $message = join('',@{$message}) if ref $message eq "ARRAY";
    $plugin->add_warnings($message);
}

1;