Log-Dispatch-UnixSyslog

 view release on metacpan or  search on metacpan

lib/Log/Dispatch/UnixSyslog.pm  view on Meta::CPAN

  my $const_name = "LOG_\U$arg{facility}";

  Carp::croak('provided facility value is valid but unknown?!')
    unless my $const = Unix::Syslog->can($const_name);

  my $self = {
    ident     => $arg{ident},
    facility  => scalar $const->(),
  };

  bless $self => $class;

  # this is our duty as a well-behaved Log::Dispatch plugin
  $self->_basic_init(%arg);

  # hand wringing: What if someone is re-openlog-ing after this?  Well, they
  # ought not to do that!  We could re-open every time, but let's just see how
  # this goes, for now. -- rjbs, 2020-08-11
  Unix::Syslog::openlog($self->{ident}, $arg{logopt} // 0, $self->{facility});

  return $self;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.097 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )