[RFC] make bb_[p]error_msgXXXX() functions able to direct output to syslog
Rob Landley
rob at landley.net
Sun Sep 3 15:50:06 UTC 2006
On Sunday 03 September 2006 8:39 am, Denis Vlasenko wrote:
> The solution which seems ok to me is to make bb_[p]error
> syslog aware. That is, we need a global flag variable which
> says "direct all bb_[p]error output to syslog (because
> we are daemonized and there is no usable stdout/err)"
>
> Minor problem is how to select syslog level, but it isn't
> that serious.
>
> Any objections?
Tito was doing some of this a couple weeks ago (I have a patch sitting in
my "Hmmm..." pile which I've applied to my tree and removed again at least
twice now). He wasn't teaching perror() and friends about syslog, but that
sounds like a really good idea.
Here's Tito's patch:
http://www.busybox.net/lists/busybox/2006-August/023821.html
Taking some ideas from that: How about a global integer variable that defaults
to 0. One of the higher bits is a flag you can set that says "write to
syslog", and another flag says "do not write to stderr", and then the bottom
four or five bits can be masked off and used as the log level.
Sound reasonable?
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list