README
1This is Perl module Amon2::Plugin::LogDispatch.
2
3INSTALLATION
4
5Amon2::Plugin::LogDispatch installation is straightforward. If your CPAN shell is set up,
6you should just be able to do
7
8% cpan Amon2::Plugin::LogDispatch
9
10Download it, unpack it, then build it as per the usual:
11
12% perl Makefile.PL
13% make && make test
14
15Then install it:
16
17% make install
18
19DOCUMENTATION
20
21Amon2::Plugin::LogDispatch documentation is available as in POD. So you can do:
22
23% perldoc Amon2::Plugin::LogDispatch
24
README.pod
1package Amon2::Plugin::LogDispatch;
2use strict;
3use warnings;
4use 5.008001;
5our $VERSION = '0.01';
6
7use Log::Dispatch ();
8use Amon2::Util ();
9
10sub init {
11 my ($class, $c, $config) = @_;
12
13 my $conf = $c->config->{'Log::Dispatch'}
14 || die "missing configuration for LogDispatch plugin(\$c->config->{'Log::Dispatch'} is undefined)";
15 my $logger = Log::Dispatch->new(%$conf);
16 Amon2::Util::add_method($c, 'log', sub { $logger });
17}
18
191;
20__END__
21
22=encoding utf8
23
24=head1 NAME
25
26Amon2::Plugin::LogDispatch - Log::Dispatch glue for Amon2
27
28=head1 SYNOPSIS
29
30 __PACKAGE__->load_plugin('LogDispatch');
31
32 # in your config.pl
33 'Log::Dispatch' => {
34 outputs => [
35 [Screen::Color',
36 min_level => 'debug',
37 name => 'debug',
38 stderr => 1,
39 color => {
40 debug => {
41 text => 'green',
42 }
43 }
44 ],
45 ],
46 },
47
48 # in your controller
49 $c->log->emerg('help me');
50
51=head1 DESCRIPTION
52
53This is a L<Log::Dispatch> glue for L<Amon2>. This module still maintained, but I don't use this module on production environment today.
54I'm a user of L<Log::Minimal>.
55
56=head1 AUTHOR
57
58Tokuhiro Matsuno E<lt>tokuhirom AAJKLFJEF GMAIL COME<gt>
59
60=head1 SEE ALSO
61
62L<Amon2>, L<Log::Dispatch>
63
64=head1 LICENSE
65
66Copyright (C) Tokuhiro Matsuno
67
68This library is free software; you can redistribute it and/or modify
69it under the same terms as Perl itself.
70
71=cut
72