| 1 | # $Id: Syslog.pm 446 2004-12-27 00:57:57Z sungo $ | ||||||||||||||
| 2 | package POE::Component::Server::Syslog; | ||||||||||||||
| 3 | 3 | $POE::Component::Server::Syslog::VERSION = '1.22'; | |||||||||||||
| 4 | #ABSTRACT: syslog services for POE | ||||||||||||||
| 5 | |||||||||||||||
| 6 | # Docs at the end. | ||||||||||||||
| 7 | |||||||||||||||
| 8 | 3 | ▶ | use 5.006001; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 9 | 3 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 10 | 3 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 11 | |||||||||||||||
| 12 | 3 | ▶ | use POE; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 13 | 3 | ▶ | use POE::Component::Server::Syslog::TCP; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 14 | 3 | ▶ | use POE::Component::Server::Syslog::UDP; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 15 | |||||||||||||||
| 16 | 2 | ▶ | sub spawn { | ||||||||||||
|
Subroutine
spawn: called CC=4 SCAR=14.4
Pod
documented
| |||||||||||||||
| 17 | 2 | my $class = shift; | |||||||||||||
| 18 | 2 | my %args = @_; | |||||||||||||
| 19 | 2 | my $type = delete $args{Type}; | |||||||||||||
| 20 | |||||||||||||||
| 21 | 2 | my $s; | |||||||||||||
| 22 | 2 | ▶ | if($type) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 23 | 2 | ▶ | if($type eq 'tcp') { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 24 | 1 | $s = POE::Component::Server::Syslog::TCP->spawn( | |||||||||||||
| 25 | %args, | ||||||||||||||
| 26 | ); | ||||||||||||||
| 27 | } elsif ($type eq 'udp') { | ||||||||||||||
| 28 | 1 | $s = POE::Component::Server::Syslog::UDP->spawn( | |||||||||||||
| 29 | %args, | ||||||||||||||
| 30 | ); | ||||||||||||||
| 31 | } else { | ||||||||||||||
| 32 | 0 | return undef; | |||||||||||||
| 33 | } | ||||||||||||||
| 34 | } else { | ||||||||||||||
| 35 | 0 | $s = POE::Component::Server::Syslog::UDP->spawn( | |||||||||||||
| 36 | %args, | ||||||||||||||
| 37 | ); | ||||||||||||||
| 38 | } | ||||||||||||||
| 39 | 2 | return $s; | |||||||||||||
| 40 | } | ||||||||||||||
| 41 | |||||||||||||||
| 42 | 3 | 1; | |||||||||||||
| 43 | |||||||||||||||
| 44 | |||||||||||||||
| 45 | # sungo // vim: ts=4 sw=4 noexpandtab | ||||||||||||||
| 46 | |||||||||||||||
| 47 | __END__ | ||||||||||||||