File Coverage

blib/lib/Log/Syslog/Fast/Constants.pm
Criterion Covered Total %
statement 30 31 96.7
branch 1 2 50.0
condition n/a
subroutine 10 10 100.0
pod n/a
total 41 43 95.3


line stmt bran cond sub pod time code
1             package Log::Syslog::Fast::Constants;
2              
3 16     16   58 use strict;
  16         18  
  16         426  
4 16     16   57 use warnings;
  16         16  
  16         288  
5              
6 16     16   4812 use Log::Syslog::Constants ();
  16         13305  
  16         289  
7 16     16   77 use Carp 'croak';
  16         25  
  16         1339  
8              
9             require Exporter;
10             our @ISA = qw(Exporter);
11              
12             # protocols
13 16     16   66 use constant LOG_UDP => 0; # UDP
  16         19  
  16         933  
14 16     16   62 use constant LOG_TCP => 1; # TCP
  16         15  
  16         662  
15 16     16   65 use constant LOG_UNIX => 2; # UNIX socket
  16         19  
  16         596  
16              
17             # formats
18 16     16   91 use constant LOG_RFC3164 => 0;
  16         16  
  16         639  
19 16     16   68 use constant LOG_RFC5424 => 1;
  16         14  
  16         3335  
20              
21             our @EXPORT = ();
22             our %EXPORT_TAGS = (
23             protos => [qw/ LOG_TCP LOG_UDP LOG_UNIX /],
24             formats => [qw/ LOG_RFC3164 LOG_RFC5424 /],
25             );
26             $EXPORT_TAGS{$_} = $Log::Syslog::Constants::EXPORT_TAGS{$_}
27             for qw(facilities severities);
28             our @EXPORT_OK = @{ $EXPORT_TAGS{all} } = map {@$_} values %EXPORT_TAGS;
29              
30             sub AUTOLOAD {
31 40     40   91491 (my $meth = our $AUTOLOAD) =~ s/.*:://;
32 40 50       325 if (Log::Syslog::Constants->can($meth)) {
33 40         415 return Log::Syslog::Constants->$meth(@_);
34             }
35 0           croak "Undefined subroutine $AUTOLOAD";
36             }
37              
38             1;