mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Isaac Dunham <ibid.ag@gmail.com>
To: musl@lists.openwall.com
Subject: fmtmsg, syslog, and /dev/console
Date: Fri, 2 May 2014 07:30:51 -0700	[thread overview]
Message-ID: <20140502143050.GA513@muslin> (raw)

Hello,
As far as I can tell, the fmtmsg patch is waiting for comments due to the
use of /dev/console; syslog() does not write to /dev/console, and Rich
was asking about consistency. In other words, should both functions, 
neither, or only one write to /dev/console?

I would argue that making syslog() not write to the system console is 
reasonable since the console is a peripheral fallback in case of the 
failure of the logging facility, but that fmtmsg() is intended to 
generate a message for reading immediately, which requires the ability to
write to the system console.

If stderr is redirected to a log (or if it's closed, as in a forking daemon),
one would likely not have opportunity to read messages in a timely manner 
unless a log-watcher is installed.

On the other side of things, if syslog() ends up not being able to log
messages it usually means someone doesn't care about logs.

---
The standard describes the two functions thus (current posix-manpages, 
corresponding to POSIX2013):

The syslog() function shall send a message to an implementation-defined logging facility, which may log it in an implementation-defined system log, write it to the system console, forward it to a list of users, or forward it to the logging facility on another host over the network.

The fmtmsg() function shall display messages in a specified format 
instead of the traditonal printf() function.
Based on a message's classification component, fmtmsg() shall write a 
formatted message either to standard error, to the console, or to both.


Thanks,
Isaac Dunham


                 reply	other threads:[~2014-05-02 14:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140502143050.GA513@muslin \
    --to=ibid.ag@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).