File Coverage

blib/lib/Log/Syslog/Fast/Constants.pm
Criterion Covered Total %
statement 33 34 97.0
branch 1 2 50.0
condition n/a
subroutine 11 11 100.0
pod n/a
total 45 47 95.7


line stmt bran cond sub pod time code
1             package Log::Syslog::Fast::Constants;
2              
3 16     16   98 use strict;
  16         43  
  16         503  
4 16     16   78 use warnings;
  16         31  
  16         371  
5              
6 16     16   3858 use Log::Syslog::Constants ();
  16         15728  
  16         324  
7 16     16   84 use Carp 'croak';
  16         34  
  16         1592  
8              
9             require Exporter;
10             our @ISA = qw(Exporter);
11              
12             # protocols
13 16     16   104 use constant LOG_UDP => 0; # UDP
  16         34  
  16         858  
14 16     16   94 use constant LOG_TCP => 1; # TCP
  16         30  
  16         1088  
15 16     16   105 use constant LOG_UNIX => 2; # UNIX socket
  16         28  
  16         821  
16              
17             # formats
18 16     16   94 use constant LOG_RFC3164 => 0;
  16         38  
  16         843  
19 16     16   101 use constant LOG_RFC5424 => 1;
  16         39  
  16         788  
20 16     16   165 use constant LOG_RFC3164_LOCAL => 2;
  16         32  
  16         4640  
21              
22             our @EXPORT = ();
23             our %EXPORT_TAGS = (
24             protos => [qw/ LOG_TCP LOG_UDP LOG_UNIX /],
25             formats => [qw/ LOG_RFC3164 LOG_RFC5424 LOG_RFC3164_LOCAL /],
26             );
27             $EXPORT_TAGS{$_} = $Log::Syslog::Constants::EXPORT_TAGS{$_}
28             for qw(facilities severities);
29             our @EXPORT_OK = @{ $EXPORT_TAGS{all} } = map {@$_} values %EXPORT_TAGS;
30              
31             sub AUTOLOAD {
32 40     40   413141 (my $meth = our $AUTOLOAD) =~ s/.*:://;
33 40 50       299 if (Log::Syslog::Constants->can($meth)) {
34 40         433 return Log::Syslog::Constants->$meth(@_);
35             }
36 0           croak "Undefined subroutine $AUTOLOAD";
37             }
38              
39             1;