Skip Menu |

This queue is for tickets about the Sys-Syslog CPAN distribution.

Report information
The Basics
Id: 20353
Status: resolved
Priority: 0/
Queue: Sys-Syslog

People
Owner: Nobody in particular
Requestors: jwm [...] horde.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 0.14



Subject: LOG_EMERG unusable
It seems LOG_EMERG is unusable with Sys::Syslog. Passing LOG_EMERG as the first argument ($priority) to Sys::Syslog::syslog() causes perl to croak. sys/syslog.ph: eval 'sub LOG_EMERG () {0;}' unless defined(&LOG_EMERG); Syslog.pm: 199 sub syslog { 200 my $priority = shift; 201 my $mask = shift; 202 my ($message, $buf); 203 my (@words, $num, $numpri, $numfac, $sum); 204 my $failed = undef; 205 my $fail_time = undef; 206 my $error = $!; 207 208 my $facility = $facility; # may need to change temporarily. 209 210 croak "syslog: expecting argument \$priority" unless defined $priority; 211 croak "syslog: expecting argument \$format" unless defined $mask; 212 Line 210 croaks since $priority == 0 when LOG_EMERG is passed.
Subject: Re: [rt.cpan.org #20353] LOG_EMERG unusable
Date: Mon, 10 Jul 2006 11:04:44 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <maddingue [...] free.fr>
Show quoted text
> It seems LOG_EMERG is unusable with Sys::Syslog. Passing LOG_EMERG as > the first argument ($priority) to Sys::Syslog::syslog() causes perl to > croak.
I can't reproduce your problem, LOG_EMERG works for me. The following one-liner $ perl -wMSys::Syslog=:standard,:macros -e 'openlog("perl", "pid,ndelay", "local0"); syslog(LOG_EMERG, "test syslog message local0/emerg")' produces this message in my /var/log/syslog under Linux: Jul 10 06:54:13 localhost perl[2050]: test syslog message local0/emerg which is what I expect. [...] Show quoted text
> 210 croak "syslog: expecting argument \$priority" unless defined > $priority;
Show quoted text
> Line 210 croaks since $priority == 0 when LOG_EMERG is passed.
Shouldn't croak if LOG_EMERG is passed because its value is zero, which is defined. Did you pass the :macros import option to Sys::Sylog? What is your OS, Perl and Sys::Syslog version? -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
From: jwm [...] horde.net
On Mon Jul 10 05:05:16 2006, maddingue@free.fr wrote: Show quoted text
> > Line 210 croaks since $priority == 0 when LOG_EMERG is passed.
> > Shouldn't croak if LOG_EMERG is passed because its value is zero, > which is defined.
D'oh - this system had an older version of Sys::Syslog installed, but when I checked 0.16 before reporting this bug, I overlooked the 'defined' that appeared. :-) Sorry for the bother.
Subject: Re: [rt.cpan.org #20353] LOG_EMERG unusable
Date: Mon, 10 Jul 2006 15:46:07 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <maddingue [...] free.fr>
Show quoted text
> D'oh - this system had an older version of Sys::Syslog installed, but > when I checked 0.16 before reporting this bug, I overlooked the > 'defined' that appeared. :-) Sorry for the bother.
No problem. Closing the ticket. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.