Date: Thu, 6 Sep 2001 05:30:01 -0700 (PDT) From: SUGIMURA Takashi =?iso-2022-jp?B?GyRCP3lCPBsoQiAbJEI1LjtOGyhC?= <sugimura@YasudaKei.org> To: freebsd-doc@freebsd.org Subject: Re: docs/30374: logger(1) manpage has wrong with default value of -p option Message-ID: <200109061230.f86CU1e75804@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR docs/30374; it has been noted by GNATS.
From: SUGIMURA Takashi =?iso-2022-jp?B?GyRCP3lCPBsoQiAbJEI1LjtOGyhC?= <sugimura@YasudaKei.org>
To: freebsd-gnats-submit@freebsd.org
Cc: ru@freebsd.org
Subject: Re: docs/30374: logger(1) manpage has wrong with default value of
-p option
Date: Thu, 06 Sep 2001 21:25:45 +0900
I am very sad you've closed the PR.
>> No, I tried many other facility and priority, then I know that
>> (LOG_USER | LOG_NOTICE) is <13>.
>>
>Err. Is't impossible to generate a LOG_KERN using syslog(3).
>Only kernel can generate these.
>
I see, but this problem is not concern about syslog(3).
>LOG_KERN | LOG_NOTICE == LOG_NOTICE, as LOG_KERN is defined as (0<<3).
Yes, I know, of course.
LOG_NOTICE is decoded to <5>, so LOG_KERN | LOG_NOTICE is <5>, not <13>.
13 = (1<<3) | 5.
>So if you call ``logger -p kern.notice'', that becomes as if it
>were ``logger -p user.notice''. This is also documented in the
>syslog(3) manpage:
>
Is it right?
I say that about logger(1).
Please see main() on /usr/src/usr.bin/logger/logger.c:
----------------
int
main(argc, argv)
int argc;
char *argv[];
{
int ch, logflags, pri;
char *tag, *host, buf[1024];
tag = NULL;
host = NULL;
pri = LOG_NOTICE;
logflags = 0;
unsetenv("TZ");
while ((ch = getopt(argc, argv, "46Af:h:ip:st:")) != -1)
(snip)
----------------
This shows the default value of variable "pri" is "LOG_NOTICE",
it is not (LOG_USER | LOG_NOTICE) as you said.
And, logger(1) don't use syslog(3) functions, simply send a UDP packet
to the port 514.
---
SUGIMURA Takashi <sugimura@jp.FreeBSD.org> <sugimura@YasudaKei.org>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109061230.f86CU1e75804>
