1Log::Dispatch::Array(3)User Contributed Perl DocumentatioLnog::Dispatch::Array(3)
2
3
4

NAME

6       Log::Dispatch::Array - log events to an array (reference)
7

VERSION

9       version 1.003
10

SYNOPSIS

12         use Log::Dispatch;
13         use Log::Dispatch::Array;
14
15         my $log = Log::Dispatch->new;
16
17         my $target = [];
18
19         $log->add(Log::Dispatch::Array->new(
20           name      => 'text_table',
21           min_level => 'debug',
22           array     => $target,
23         ));
24
25         $log->warn($_) for @events;
26
27         # now $target refers to an array of events
28

DESCRIPTION

30       This provides a Log::Dispatch log output system that appends logged
31       events to an array reference.  This is probably only useful for testing
32       the logging of your code.
33

METHODS

35   new
36        my $table_log = Log::Dispatch::Array->new(\%arg);
37
38       This method constructs a new Log::Dispatch::Array output object.  Valid
39       arguments are:
40
41         array - a reference to an array to append to; defaults to an attr on
42                 $table_log
43
44   array
45       This method returns a reference to the array to which logging is being
46       performed.
47
48   log_message
49       This is the method which performs the actual logging, as detailed by
50       Log::Dispatch::Output.
51

AUTHOR

53       Ricardo SIGNES <rjbs@cpan.org>
54
56       This software is copyright (c) 2008 by Ricardo SIGNES.
57
58       This is free software; you can redistribute it and/or modify it under
59       the same terms as the Perl 5 programming language system itself.
60
61
62
63perl v5.34.0                      2021-07-22           Log::Dispatch::Array(3)
Impressum