| 1 | package Net::MessageBus::Base; | ||||||||||
| 2 | |||||||||||
| 3 | 5 | ▶ | use 5.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | =head1 NAME | ||||||||||
| 8 | |||||||||||
| 9 | Net::MessageBus::Base - Base class for Net::MessageBus modules | ||||||||||
| 10 | |||||||||||
| 11 | =head1 VERSION | ||||||||||
| 12 | |||||||||||
| 13 | Version 0.08 | ||||||||||
| 14 | |||||||||||
| 15 | =cut | ||||||||||
| 16 | |||||||||||
| 17 | 5 | our $VERSION = '0.08'; | |||||||||
| 18 | |||||||||||
| 19 | =head1 SUBROUTINES/METHODS | ||||||||||
| 20 | |||||||||||
| 21 | =head2 logger | ||||||||||
| 22 | |||||||||||
| 23 | Getter / Setter for the logging object | ||||||||||
| 24 | |||||||||||
| 25 | =cut | ||||||||||
| 26 | 405 | ▶ | sub logger { | ||||||||
|
Subroutine
logger: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||
| 27 | 405 | my $self = shift; | |||||||||
| 28 | 405 | ▶ | if ($_[0]) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 0 | $self->{logger} = $_[0]; | |||||||||
| 30 | } | ||||||||||
| 31 | 405 | return $self->{logger}; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | |||||||||||
| 35 | =head2 create_default_logger | ||||||||||
| 36 | |||||||||||
| 37 | Creates the default logger that will be used | ||||||||||
| 38 | |||||||||||
| 39 | =cut | ||||||||||
| 40 | 23 | ▶ | sub create_default_logger { | ||||||||
|
Subroutine
create_default_logger: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 41 | 23 | my $logger; | |||||||||
| 42 | 23 | eval { | |||||||||
| 43 | 5 | ▶ | use Log::Log4perl qw(:easy); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 44 | 23 | Log::Log4perl->easy_init($ERROR); | |||||||||
| 45 | 23 | $logger = Log::Log4perl->get_logger; | |||||||||
| 46 | }; | ||||||||||
| 47 | 23 | ▶ | if ($@) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 0 | die "Error creating default logger for ". __PACKAGE__ . | |||||||||
| 49 | ", please specify one or install Log::Log4perl! $@"; | ||||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 23 | return $logger; | |||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | |||||||||||
| 56 | =head1 AUTHOR | ||||||||||
| 57 | |||||||||||
| 58 | Horea Gligan, C<< <gliganh at gmail.com> >> | ||||||||||
| 59 | |||||||||||
| 60 | =head1 BUGS | ||||||||||
| 61 | |||||||||||
| 62 | Please report any bugs or feature requests to C<bug-net-MessageBus at rt.cpan.org>, or through | ||||||||||
| 63 | the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-MessageBus>. I will be notified, and then you'll | ||||||||||
| 64 | automatically be notified of progress on your bug as I make changes. | ||||||||||
| 65 | |||||||||||
| 66 | |||||||||||
| 67 | |||||||||||
| 68 | |||||||||||
| 69 | =head1 SUPPORT | ||||||||||
| 70 | |||||||||||
| 71 | You can find documentation for this module with the perldoc command. | ||||||||||
| 72 | |||||||||||
| 73 | perldoc Net::MessageBus | ||||||||||
| 74 | |||||||||||
| 75 | |||||||||||
| 76 | You can also look for information at: | ||||||||||
| 77 | |||||||||||
| 78 | =over 4 | ||||||||||
| 79 | |||||||||||
| 80 | =item * RT: CPAN's request tracker (report bugs here) | ||||||||||
| 81 | |||||||||||
| 82 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-MessageBus> | ||||||||||
| 83 | |||||||||||
| 84 | =item * AnnoCPAN: Annotated CPAN documentation | ||||||||||
| 85 | |||||||||||
| 86 | L<http://annocpan.org/dist/Net-MessageBus> | ||||||||||
| 87 | |||||||||||
| 88 | =item * CPAN Ratings | ||||||||||
| 89 | |||||||||||
| 90 | L<http://cpanratings.perl.org/d/Net-MessageBus> | ||||||||||
| 91 | |||||||||||
| 92 | =item * Search CPAN | ||||||||||
| 93 | |||||||||||
| 94 | L<http://search.cpan.org/dist/Net-MessageBus/> | ||||||||||
| 95 | |||||||||||
| 96 | =back | ||||||||||
| 97 | |||||||||||
| 98 | |||||||||||
| 99 | =head1 ACKNOWLEDGEMENTS | ||||||||||
| 100 | |||||||||||
| 101 | |||||||||||
| 102 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 103 | |||||||||||
| 104 | Copyright 2012 Horea Gligan. | ||||||||||
| 105 | |||||||||||
| 106 | This program is free software; you can redistribute it and/or modify it | ||||||||||
| 107 | under the terms of either: the GNU General Public License as published | ||||||||||
| 108 | by the Free Software Foundation; or the Artistic License. | ||||||||||
| 109 | |||||||||||
| 110 | See http://dev.perl.org/licenses/ for more information. | ||||||||||
| 111 | |||||||||||
| 112 | |||||||||||
| 113 | =cut | ||||||||||
| 114 | |||||||||||
| 115 | 5 | 1; # End of Net::MessageBus::Base | |||||||||