[RFC] make bb_[p]error_msgXXXX() functions able to direct output to syslog
Denis Vlasenko
vda.linux at googlemail.com
Sun Sep 3 18:36:12 UTC 2006
On Sunday 03 September 2006 20:02, Tito wrote:
> > I prefer:
> >
> > bb_logmode = LOGMODE_BOTH;
> > ...
> > xopen(...); /* will output error to stderr & to syslog */
>
> So you will need to reset this multiple times in the same app:
>
> bb_logmode = LOGMODE_BOTH;
> msg(a)
> bb_logmode = LOGMODE_*;
> msg(b)
> bb_logmode = LOGMODE_BOTH;
>
> etc.
>
> maybe a size increase!?!
Yes, mighty 1 (one) instruction per store. Yeah, tragedy...
BTW, this particular example doesn't really need switching:
bb_logmode = LOGMODE_BOTH;
msg(a);
/* not needed: bb_logmode = LOGMODE_STDIO; */
printf(b);
/* not needed: bb_logmode = LOGMODE_BOTH; */
...
> I can agree on something like this for
> int bb_facility = LOG_USER; (or LOG_DAEMON)
> as this will be set just once per app, but
> logmode maybe could change multiple times?
...which is not a problem.
--
vda
More information about the busybox
mailing list